on develop help sign in
Adding Firebase Rules
commita5c5fbf695007f3e89da355860adb64f3a1218d8 authorBrendan Hay <brendan.g.hay@gmail.com> dateMon 20 Jun 2016, 10:22 (10 years ago) parent3e86a97
21 files changed+3329
gen/annex/firebaserules.json+4 gogol-firebase-rules/LICENSE+367 gogol-firebase-rules/Makefile+1 gogol-firebase-rules/README.md+28 gogol-firebase-rules/Setup.hs+2 gogol-firebase-rules/gen/Network/Google/FirebaseRules.hs+167 gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types.hs+111 gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types/Product.hs+582 gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types/Sum.hs+88 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Create.hs+218 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Delete.hs+169 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Get.hs+165 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/List.hs+232 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Update.hs+201 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/Create.hs+191 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/Delete.hs+171 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/Get.hs+169 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/List.hs+202 gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Test.hs+205 gogol-firebase-rules/gogol-firebase-rules.cabal+56 gogol-firebase-rules/src/.gitkeep
gen/annex/firebaserules.jsonnew file+4
@@ -0,0 +1,4 @@
1+{
2+ "library": "firebase-rules",
3+ "canonicalName": "FirebaseRules"
4+}
gogol-firebase-rules/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-firebase-rules/Makefilenew file+1
@@ -0,0 +1 @@
1+include ../share/library.mk
gogol-firebase-rules/README.mdnew file+28
@@ -0,0 +1,28 @@
1+# gogol-firebase-rules
2+
3+* [Version](#version)
4+* [Description](#description)
5+* [Contribute](#contribute)
6+* [Licence](#licence)
7+
8+
9+## Version
10+
11+`0.0.1`
12+
13+
14+## Description
15+
16+A client library for the Google Firebase Rules.
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-firebase-rules` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
gogol-firebase-rules/Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
gogol-firebase-rules/gen/Network/Google/FirebaseRules.hsnew file+167
@@ -0,0 +1,167 @@
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.FirebaseRules
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+-- Creates and manages rules that determine when a Firebase Rules-enabled
17+-- service should permit a request.
18+--
19+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference>
20+module Network.Google.FirebaseRules
21+ (
22+ -- * Service Configuration
23+ firebaseRulesService
24+
25+ -- * OAuth Scopes
26+ , cloudPlatformScope
27+
28+ -- * API Declaration
29+ , FirebaseRulesAPI
30+
31+ -- * Resources
32+
33+ -- ** firebaserules.projects.releases.create
34+ , module Network.Google.Resource.FirebaseRules.Projects.Releases.Create
35+
36+ -- ** firebaserules.projects.releases.delete
37+ , module Network.Google.Resource.FirebaseRules.Projects.Releases.Delete
38+
39+ -- ** firebaserules.projects.releases.get
40+ , module Network.Google.Resource.FirebaseRules.Projects.Releases.Get
41+
42+ -- ** firebaserules.projects.releases.list
43+ , module Network.Google.Resource.FirebaseRules.Projects.Releases.List
44+
45+ -- ** firebaserules.projects.releases.update
46+ , module Network.Google.Resource.FirebaseRules.Projects.Releases.Update
47+
48+ -- ** firebaserules.projects.rulesets.create
49+ , module Network.Google.Resource.FirebaseRules.Projects.Rulesets.Create
50+
51+ -- ** firebaserules.projects.rulesets.delete
52+ , module Network.Google.Resource.FirebaseRules.Projects.Rulesets.Delete
53+
54+ -- ** firebaserules.projects.rulesets.get
55+ , module Network.Google.Resource.FirebaseRules.Projects.Rulesets.Get
56+
57+ -- ** firebaserules.projects.rulesets.list
58+ , module Network.Google.Resource.FirebaseRules.Projects.Rulesets.List
59+
60+ -- ** firebaserules.projects.test
61+ , module Network.Google.Resource.FirebaseRules.Projects.Test
62+
63+ -- * Types
64+
65+ -- ** SourcePosition
66+ , SourcePosition
67+ , sourcePosition
68+ , spLine
69+ , spColumn
70+ , spFileName
71+
72+ -- ** Empty
73+ , Empty
74+ , empty
75+
76+ -- ** ListReleasesResponse
77+ , ListReleasesResponse
78+ , listReleasesResponse
79+ , lrrNextPageToken
80+ , lrrReleases
81+
82+ -- ** TestRulesetResponse
83+ , TestRulesetResponse
84+ , testRulesetResponse
85+ , trrIssues
86+
87+ -- ** Release
88+ , Release
89+ , release
90+ , rRulesetName
91+ , rUpdateTime
92+ , rName
93+ , rCreateTime
94+
95+ -- ** Ruleset
96+ , Ruleset
97+ , ruleset
98+ , rulName
99+ , rulSource
100+ , rulCreateTime
101+
102+ -- ** Xgafv
103+ , Xgafv (..)
104+
105+ -- ** IssueSeverity
106+ , IssueSeverity (..)
107+
108+ -- ** Source
109+ , Source
110+ , source
111+ , sFiles
112+
113+ -- ** TestRulesetRequest
114+ , TestRulesetRequest
115+ , testRulesetRequest
116+ , trrSource
117+
118+ -- ** File
119+ , File
120+ , file
121+ , fFingerprint
122+ , fContent
123+ , fName
124+
125+ -- ** ListRulesetsResponse
126+ , ListRulesetsResponse
127+ , listRulesetsResponse
128+ , lRulesets
129+ , lNextPageToken
130+
131+ -- ** Issue
132+ , Issue
133+ , issue
134+ , iSourcePosition
135+ , iSeverity
136+ , iDescription
137+ ) where
138+
139+import Network.Google.FirebaseRules.Types
140+import Network.Google.Prelude
141+import Network.Google.Resource.FirebaseRules.Projects.Releases.Create
142+import Network.Google.Resource.FirebaseRules.Projects.Releases.Delete
143+import Network.Google.Resource.FirebaseRules.Projects.Releases.Get
144+import Network.Google.Resource.FirebaseRules.Projects.Releases.List
145+import Network.Google.Resource.FirebaseRules.Projects.Releases.Update
146+import Network.Google.Resource.FirebaseRules.Projects.Rulesets.Create
147+import Network.Google.Resource.FirebaseRules.Projects.Rulesets.Delete
148+import Network.Google.Resource.FirebaseRules.Projects.Rulesets.Get
149+import Network.Google.Resource.FirebaseRules.Projects.Rulesets.List
150+import Network.Google.Resource.FirebaseRules.Projects.Test
151+
152+{- $resources
153+TODO
154+-}
155+
156+-- | Represents the entirety of the methods and resources available for the Firebase Rules API service.
157+type FirebaseRulesAPI =
158+ ProjectsRulesetsListResource :<|>
159+ ProjectsRulesetsGetResource
160+ :<|> ProjectsRulesetsCreateResource
161+ :<|> ProjectsRulesetsDeleteResource
162+ :<|> ProjectsReleasesListResource
163+ :<|> ProjectsReleasesGetResource
164+ :<|> ProjectsReleasesCreateResource
165+ :<|> ProjectsReleasesDeleteResource
166+ :<|> ProjectsReleasesUpdateResource
167+ :<|> ProjectsTestResource
gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types.hsnew file+111
@@ -0,0 +1,111 @@
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.FirebaseRules.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.FirebaseRules.Types
18+ (
19+ -- * Service Configuration
20+ firebaseRulesService
21+
22+ -- * OAuth Scopes
23+ , cloudPlatformScope
24+
25+ -- * SourcePosition
26+ , SourcePosition
27+ , sourcePosition
28+ , spLine
29+ , spColumn
30+ , spFileName
31+
32+ -- * Empty
33+ , Empty
34+ , empty
35+
36+ -- * ListReleasesResponse
37+ , ListReleasesResponse
38+ , listReleasesResponse
39+ , lrrNextPageToken
40+ , lrrReleases
41+
42+ -- * TestRulesetResponse
43+ , TestRulesetResponse
44+ , testRulesetResponse
45+ , trrIssues
46+
47+ -- * Release
48+ , Release
49+ , release
50+ , rRulesetName
51+ , rUpdateTime
52+ , rName
53+ , rCreateTime
54+
55+ -- * Ruleset
56+ , Ruleset
57+ , ruleset
58+ , rulName
59+ , rulSource
60+ , rulCreateTime
61+
62+ -- * Xgafv
63+ , Xgafv (..)
64+
65+ -- * IssueSeverity
66+ , IssueSeverity (..)
67+
68+ -- * Source
69+ , Source
70+ , source
71+ , sFiles
72+
73+ -- * TestRulesetRequest
74+ , TestRulesetRequest
75+ , testRulesetRequest
76+ , trrSource
77+
78+ -- * File
79+ , File
80+ , file
81+ , fFingerprint
82+ , fContent
83+ , fName
84+
85+ -- * ListRulesetsResponse
86+ , ListRulesetsResponse
87+ , listRulesetsResponse
88+ , lRulesets
89+ , lNextPageToken
90+
91+ -- * Issue
92+ , Issue
93+ , issue
94+ , iSourcePosition
95+ , iSeverity
96+ , iDescription
97+ ) where
98+
99+import Network.Google.FirebaseRules.Types.Product
100+import Network.Google.FirebaseRules.Types.Sum
101+import Network.Google.Prelude
102+
103+-- | Default request referring to version 'v1' of the Firebase Rules API. This contains the host and root path used as a starting point for constructing service requests.
104+firebaseRulesService :: ServiceConfig
105+firebaseRulesService
106+ = defaultService (ServiceId "firebaserules:v1")
107+ "firebaserules.googleapis.com"
108+
109+-- | View and manage your data across Google Cloud Platform services
110+cloudPlatformScope :: Proxy '["https://www.googleapis.com/auth/cloud-platform"]
111+cloudPlatformScope = Proxy;
gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types/Product.hsnew file+582
@@ -0,0 +1,582 @@
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.FirebaseRules.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.FirebaseRules.Types.Product where
19+
20+import Network.Google.FirebaseRules.Types.Sum
21+import Network.Google.Prelude
22+
23+-- | Position in the \`Source\` content including its line, column number,
24+-- and an index of the \`File\` in the \`Source\` message. Used for debug
25+-- purposes.
26+--
27+-- /See:/ 'sourcePosition' smart constructor.
28+data SourcePosition = SourcePosition'
29+ { _spLine :: !(Maybe (Textual Int32))
30+ , _spColumn :: !(Maybe (Textual Int32))
31+ , _spFileName :: !(Maybe Text)
32+ } deriving (Eq,Show,Data,Typeable,Generic)
33+
34+-- | Creates a value of 'SourcePosition' with the minimum fields required to make a request.
35+--
36+-- Use one of the following lenses to modify other fields as desired:
37+--
38+-- * 'spLine'
39+--
40+-- * 'spColumn'
41+--
42+-- * 'spFileName'
43+sourcePosition
44+ :: SourcePosition
45+sourcePosition =
46+ SourcePosition'
47+ { _spLine = Nothing
48+ , _spColumn = Nothing
49+ , _spFileName = Nothing
50+ }
51+
52+-- | Line number of the source fragment. 1-based.
53+spLine :: Lens' SourcePosition (Maybe Int32)
54+spLine
55+ = lens _spLine (\ s a -> s{_spLine = a}) .
56+ mapping _Coerce
57+
58+-- | First column on the source line associated with the source fragment.
59+spColumn :: Lens' SourcePosition (Maybe Int32)
60+spColumn
61+ = lens _spColumn (\ s a -> s{_spColumn = a}) .
62+ mapping _Coerce
63+
64+-- | Name of the \`File\`.
65+spFileName :: Lens' SourcePosition (Maybe Text)
66+spFileName
67+ = lens _spFileName (\ s a -> s{_spFileName = a})
68+
69+instance FromJSON SourcePosition where
70+ parseJSON
71+ = withObject "SourcePosition"
72+ (\ o ->
73+ SourcePosition' <$>
74+ (o .:? "line") <*> (o .:? "column") <*>
75+ (o .:? "fileName"))
76+
77+instance ToJSON SourcePosition where
78+ toJSON SourcePosition'{..}
79+ = object
80+ (catMaybes
81+ [("line" .=) <$> _spLine,
82+ ("column" .=) <$> _spColumn,
83+ ("fileName" .=) <$> _spFileName])
84+
85+-- | A generic empty message that you can re-use to avoid defining duplicated
86+-- empty messages in your APIs. A typical example is to use it as the
87+-- request or the response type of an API method. For instance: service Foo
88+-- { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The
89+-- JSON representation for \`Empty\` is empty JSON object \`{}\`.
90+--
91+-- /See:/ 'empty' smart constructor.
92+data Empty =
93+ Empty'
94+ deriving (Eq,Show,Data,Typeable,Generic)
95+
96+-- | Creates a value of 'Empty' with the minimum fields required to make a request.
97+--
98+empty
99+ :: Empty
100+empty = Empty'
101+
102+instance FromJSON Empty where
103+ parseJSON = withObject "Empty" (\ o -> pure Empty')
104+
105+instance ToJSON Empty where
106+ toJSON = const emptyObject
107+
108+-- | The response for FirebaseRulesService.ListReleases.
109+--
110+-- /See:/ 'listReleasesResponse' smart constructor.
111+data ListReleasesResponse = ListReleasesResponse'
112+ { _lrrNextPageToken :: !(Maybe Text)
113+ , _lrrReleases :: !(Maybe [Release])
114+ } deriving (Eq,Show,Data,Typeable,Generic)
115+
116+-- | Creates a value of 'ListReleasesResponse' with the minimum fields required to make a request.
117+--
118+-- Use one of the following lenses to modify other fields as desired:
119+--
120+-- * 'lrrNextPageToken'
121+--
122+-- * 'lrrReleases'
123+listReleasesResponse
124+ :: ListReleasesResponse
125+listReleasesResponse =
126+ ListReleasesResponse'
127+ { _lrrNextPageToken = Nothing
128+ , _lrrReleases = Nothing
129+ }
130+
131+-- | The pagination token to retrieve the next page of results. If the value
132+-- is empty, no further results remain.
133+lrrNextPageToken :: Lens' ListReleasesResponse (Maybe Text)
134+lrrNextPageToken
135+ = lens _lrrNextPageToken
136+ (\ s a -> s{_lrrNextPageToken = a})
137+
138+-- | List of \`Release\` instances.
139+lrrReleases :: Lens' ListReleasesResponse [Release]
140+lrrReleases
141+ = lens _lrrReleases (\ s a -> s{_lrrReleases = a}) .
142+ _Default
143+ . _Coerce
144+
145+instance FromJSON ListReleasesResponse where
146+ parseJSON
147+ = withObject "ListReleasesResponse"
148+ (\ o ->
149+ ListReleasesResponse' <$>
150+ (o .:? "nextPageToken") <*>
151+ (o .:? "releases" .!= mempty))
152+
153+instance ToJSON ListReleasesResponse where
154+ toJSON ListReleasesResponse'{..}
155+ = object
156+ (catMaybes
157+ [("nextPageToken" .=) <$> _lrrNextPageToken,
158+ ("releases" .=) <$> _lrrReleases])
159+
160+-- | The response for FirebaseRulesService.TestRuleset.
161+--
162+-- /See:/ 'testRulesetResponse' smart constructor.
163+newtype TestRulesetResponse = TestRulesetResponse'
164+ { _trrIssues :: Maybe [Issue]
165+ } deriving (Eq,Show,Data,Typeable,Generic)
166+
167+-- | Creates a value of 'TestRulesetResponse' with the minimum fields required to make a request.
168+--
169+-- Use one of the following lenses to modify other fields as desired:
170+--
171+-- * 'trrIssues'
172+testRulesetResponse
173+ :: TestRulesetResponse
174+testRulesetResponse =
175+ TestRulesetResponse'
176+ { _trrIssues = Nothing
177+ }
178+
179+-- | Syntactic and semantic \`Source\` issues of varying severity. Issues of
180+-- \`ERROR\` severity will prevent tests from executing.
181+trrIssues :: Lens' TestRulesetResponse [Issue]
182+trrIssues
183+ = lens _trrIssues (\ s a -> s{_trrIssues = a}) .
184+ _Default
185+ . _Coerce
186+
187+instance FromJSON TestRulesetResponse where
188+ parseJSON
189+ = withObject "TestRulesetResponse"
190+ (\ o ->
191+ TestRulesetResponse' <$> (o .:? "issues" .!= mempty))
192+
193+instance ToJSON TestRulesetResponse where
194+ toJSON TestRulesetResponse'{..}
195+ = object (catMaybes [("issues" .=) <$> _trrIssues])
196+
197+-- | \`Release\` is a named reference to a \`Ruleset\`. Once a \`Release\`
198+-- refers to a \`Ruleset\`, rules-enabled services will be able to enforce
199+-- the \`Ruleset\`.
200+--
201+-- /See:/ 'release' smart constructor.
202+data Release = Release'
203+ { _rRulesetName :: !(Maybe Text)
204+ , _rUpdateTime :: !(Maybe DateTime')
205+ , _rName :: !(Maybe Text)
206+ , _rCreateTime :: !(Maybe DateTime')
207+ } deriving (Eq,Show,Data,Typeable,Generic)
208+
209+-- | Creates a value of 'Release' with the minimum fields required to make a request.
210+--
211+-- Use one of the following lenses to modify other fields as desired:
212+--
213+-- * 'rRulesetName'
214+--
215+-- * 'rUpdateTime'
216+--
217+-- * 'rName'
218+--
219+-- * 'rCreateTime'
220+release
221+ :: Release
222+release =
223+ Release'
224+ { _rRulesetName = Nothing
225+ , _rUpdateTime = Nothing
226+ , _rName = Nothing
227+ , _rCreateTime = Nothing
228+ }
229+
230+-- | Name of the \`Ruleset\` referred to by this \`Release\`. The \`Ruleset\`
231+-- must exist the \`Release\` to be created.
232+rRulesetName :: Lens' Release (Maybe Text)
233+rRulesetName
234+ = lens _rRulesetName (\ s a -> s{_rRulesetName = a})
235+
236+-- | Time the release was updated. \'OutputOnly
237+rUpdateTime :: Lens' Release (Maybe UTCTime)
238+rUpdateTime
239+ = lens _rUpdateTime (\ s a -> s{_rUpdateTime = a}) .
240+ mapping _DateTime
241+
242+-- | Resource name for the \`Release\`. \`Release\` names may be structured
243+-- \`app1\/prod\/v2\` or flat \`app1_prod_v2\` which affords developers a
244+-- great deal of flexibility in mapping the name to the style that best
245+-- fits their existing development practices. For example, a name could
246+-- refer to an environment, an app, a version, or some combination of
247+-- three. In the table below, for the project name \`projects\/foo\`, the
248+-- following relative release paths show how flat and structured names
249+-- might be chosen to match a desired development \/ deployment strategy.
250+-- Use Case | Flat Name | Structured Name
251+-- -------------|---------------------|---------------- Environments |
252+-- releases\/qa | releases\/qa Apps | releases\/app1_qa |
253+-- releases\/app1\/qa Versions | releases\/app1_v2_qa |
254+-- releases\/app1\/v2\/qa The delimiter between the release name path
255+-- elements can be almost anything and it should work equally well with the
256+-- release name list filter, but in many ways the structured paths provide
257+-- a clearer picture of the relationship between \`Release\` instances.
258+-- Format: \`projects\/{project_id}\/releases\/{release_id}\`
259+rName :: Lens' Release (Maybe Text)
260+rName = lens _rName (\ s a -> s{_rName = a})
261+
262+-- | Time the release was created. \'OutputOnly
263+rCreateTime :: Lens' Release (Maybe UTCTime)
264+rCreateTime
265+ = lens _rCreateTime (\ s a -> s{_rCreateTime = a}) .
266+ mapping _DateTime
267+
268+instance FromJSON Release where
269+ parseJSON
270+ = withObject "Release"
271+ (\ o ->
272+ Release' <$>
273+ (o .:? "rulesetName") <*> (o .:? "updateTime") <*>
274+ (o .:? "name")
275+ <*> (o .:? "createTime"))
276+
277+instance ToJSON Release where
278+ toJSON Release'{..}
279+ = object
280+ (catMaybes
281+ [("rulesetName" .=) <$> _rRulesetName,
282+ ("updateTime" .=) <$> _rUpdateTime,
283+ ("name" .=) <$> _rName,
284+ ("createTime" .=) <$> _rCreateTime])
285+
286+-- | \`Ruleset\` is an immutable copy of \`Source\` with a globally unique
287+-- identifier and a creation time.
288+--
289+-- /See:/ 'ruleset' smart constructor.
290+data Ruleset = Ruleset'
291+ { _rulName :: !(Maybe Text)
292+ , _rulSource :: !(Maybe Source)
293+ , _rulCreateTime :: !(Maybe DateTime')
294+ } deriving (Eq,Show,Data,Typeable,Generic)
295+
296+-- | Creates a value of 'Ruleset' with the minimum fields required to make a request.
297+--
298+-- Use one of the following lenses to modify other fields as desired:
299+--
300+-- * 'rulName'
301+--
302+-- * 'rulSource'
303+--
304+-- * 'rulCreateTime'
305+ruleset
306+ :: Ruleset
307+ruleset =
308+ Ruleset'
309+ { _rulName = Nothing
310+ , _rulSource = Nothing
311+ , _rulCreateTime = Nothing
312+ }
313+
314+-- | Name of the \`Ruleset\`. The ruleset_id is auto generated by the
315+-- service. Format: \`projects\/{project_id}\/rulesets\/{ruleset_id}\`
316+-- \'OutputOnly
317+rulName :: Lens' Ruleset (Maybe Text)
318+rulName = lens _rulName (\ s a -> s{_rulName = a})
319+
320+-- | \`Source\` for the \`Ruleset\`.
321+rulSource :: Lens' Ruleset (Maybe Source)
322+rulSource
323+ = lens _rulSource (\ s a -> s{_rulSource = a})
324+
325+-- | Time the \`Ruleset\` was created. \'OutputOnly
326+rulCreateTime :: Lens' Ruleset (Maybe UTCTime)
327+rulCreateTime
328+ = lens _rulCreateTime
329+ (\ s a -> s{_rulCreateTime = a})
330+ . mapping _DateTime
331+
332+instance FromJSON Ruleset where
333+ parseJSON
334+ = withObject "Ruleset"
335+ (\ o ->
336+ Ruleset' <$>
337+ (o .:? "name") <*> (o .:? "source") <*>
338+ (o .:? "createTime"))
339+
340+instance ToJSON Ruleset where
341+ toJSON Ruleset'{..}
342+ = object
343+ (catMaybes
344+ [("name" .=) <$> _rulName,
345+ ("source" .=) <$> _rulSource,
346+ ("createTime" .=) <$> _rulCreateTime])
347+
348+-- | \`Source\` is one or more \`File\` messages comprising a logical set of
349+-- rules.
350+--
351+-- /See:/ 'source' smart constructor.
352+newtype Source = Source'
353+ { _sFiles :: Maybe [File]
354+ } deriving (Eq,Show,Data,Typeable,Generic)
355+
356+-- | Creates a value of 'Source' with the minimum fields required to make a request.
357+--
358+-- Use one of the following lenses to modify other fields as desired:
359+--
360+-- * 'sFiles'
361+source
362+ :: Source
363+source =
364+ Source'
365+ { _sFiles = Nothing
366+ }
367+
368+-- | \`File\` set constituting the \`Source\` bundle.
369+sFiles :: Lens' Source [File]
370+sFiles
371+ = lens _sFiles (\ s a -> s{_sFiles = a}) . _Default .
372+ _Coerce
373+
374+instance FromJSON Source where
375+ parseJSON
376+ = withObject "Source"
377+ (\ o -> Source' <$> (o .:? "files" .!= mempty))
378+
379+instance ToJSON Source where
380+ toJSON Source'{..}
381+ = object (catMaybes [("files" .=) <$> _sFiles])
382+
383+-- | The request for FirebaseRulesService.TestRuleset.
384+--
385+-- /See:/ 'testRulesetRequest' smart constructor.
386+newtype TestRulesetRequest = TestRulesetRequest'
387+ { _trrSource :: Maybe Source
388+ } deriving (Eq,Show,Data,Typeable,Generic)
389+
390+-- | Creates a value of 'TestRulesetRequest' with the minimum fields required to make a request.
391+--
392+-- Use one of the following lenses to modify other fields as desired:
393+--
394+-- * 'trrSource'
395+testRulesetRequest
396+ :: TestRulesetRequest
397+testRulesetRequest =
398+ TestRulesetRequest'
399+ { _trrSource = Nothing
400+ }
401+
402+-- | \`Source\` to be checked for correctness.
403+trrSource :: Lens' TestRulesetRequest (Maybe Source)
404+trrSource
405+ = lens _trrSource (\ s a -> s{_trrSource = a})
406+
407+instance FromJSON TestRulesetRequest where
408+ parseJSON
409+ = withObject "TestRulesetRequest"
410+ (\ o -> TestRulesetRequest' <$> (o .:? "source"))
411+
412+instance ToJSON TestRulesetRequest where
413+ toJSON TestRulesetRequest'{..}
414+ = object (catMaybes [("source" .=) <$> _trrSource])
415+
416+-- | \`File\` containing source content.
417+--
418+-- /See:/ 'file' smart constructor.
419+data File = File'
420+ { _fFingerprint :: !(Maybe Base64)
421+ , _fContent :: !(Maybe Text)
422+ , _fName :: !(Maybe Text)
423+ } deriving (Eq,Show,Data,Typeable,Generic)
424+
425+-- | Creates a value of 'File' with the minimum fields required to make a request.
426+--
427+-- Use one of the following lenses to modify other fields as desired:
428+--
429+-- * 'fFingerprint'
430+--
431+-- * 'fContent'
432+--
433+-- * 'fName'
434+file
435+ :: File
436+file =
437+ File'
438+ { _fFingerprint = Nothing
439+ , _fContent = Nothing
440+ , _fName = Nothing
441+ }
442+
443+-- | Fingerprint (e.g. github sha) associated with the \`File\`.
444+fFingerprint :: Lens' File (Maybe ByteString)
445+fFingerprint
446+ = lens _fFingerprint (\ s a -> s{_fFingerprint = a})
447+ . mapping _Base64
448+
449+-- | Textual Content.
450+fContent :: Lens' File (Maybe Text)
451+fContent = lens _fContent (\ s a -> s{_fContent = a})
452+
453+-- | File name.
454+fName :: Lens' File (Maybe Text)
455+fName = lens _fName (\ s a -> s{_fName = a})
456+
457+instance FromJSON File where
458+ parseJSON
459+ = withObject "File"
460+ (\ o ->
461+ File' <$>
462+ (o .:? "fingerprint") <*> (o .:? "content") <*>
463+ (o .:? "name"))
464+
465+instance ToJSON File where
466+ toJSON File'{..}
467+ = object
468+ (catMaybes
469+ [("fingerprint" .=) <$> _fFingerprint,
470+ ("content" .=) <$> _fContent,
471+ ("name" .=) <$> _fName])
472+
473+-- | The response for FirebaseRulesService.ListRulesets
474+--
475+-- /See:/ 'listRulesetsResponse' smart constructor.
476+data ListRulesetsResponse = ListRulesetsResponse'
477+ { _lRulesets :: !(Maybe [Ruleset])
478+ , _lNextPageToken :: !(Maybe Text)
479+ } deriving (Eq,Show,Data,Typeable,Generic)
480+
481+-- | Creates a value of 'ListRulesetsResponse' with the minimum fields required to make a request.
482+--
483+-- Use one of the following lenses to modify other fields as desired:
484+--
485+-- * 'lRulesets'
486+--
487+-- * 'lNextPageToken'
488+listRulesetsResponse
489+ :: ListRulesetsResponse
490+listRulesetsResponse =
491+ ListRulesetsResponse'
492+ { _lRulesets = Nothing
493+ , _lNextPageToken = Nothing
494+ }
495+
496+-- | List of \`Ruleset\` instances.
497+lRulesets :: Lens' ListRulesetsResponse [Ruleset]
498+lRulesets
499+ = lens _lRulesets (\ s a -> s{_lRulesets = a}) .
500+ _Default
501+ . _Coerce
502+
503+-- | The pagination token to retrieve the next page of results. If the value
504+-- is empty, no further results remain.
505+lNextPageToken :: Lens' ListRulesetsResponse (Maybe Text)
506+lNextPageToken
507+ = lens _lNextPageToken
508+ (\ s a -> s{_lNextPageToken = a})
509+
510+instance FromJSON ListRulesetsResponse where
511+ parseJSON
512+ = withObject "ListRulesetsResponse"
513+ (\ o ->
514+ ListRulesetsResponse' <$>
515+ (o .:? "rulesets" .!= mempty) <*>
516+ (o .:? "nextPageToken"))
517+
518+instance ToJSON ListRulesetsResponse where
519+ toJSON ListRulesetsResponse'{..}
520+ = object
521+ (catMaybes
522+ [("rulesets" .=) <$> _lRulesets,
523+ ("nextPageToken" .=) <$> _lNextPageToken])
524+
525+-- | Issues include warnings, errors, and deprecation notices.
526+--
527+-- /See:/ 'issue' smart constructor.
528+data Issue = Issue'
529+ { _iSourcePosition :: !(Maybe SourcePosition)
530+ , _iSeverity :: !(Maybe IssueSeverity)
531+ , _iDescription :: !(Maybe Text)
532+ } deriving (Eq,Show,Data,Typeable,Generic)
533+
534+-- | Creates a value of 'Issue' with the minimum fields required to make a request.
535+--
536+-- Use one of the following lenses to modify other fields as desired:
537+--
538+-- * 'iSourcePosition'
539+--
540+-- * 'iSeverity'
541+--
542+-- * 'iDescription'
543+issue
544+ :: Issue
545+issue =
546+ Issue'
547+ { _iSourcePosition = Nothing
548+ , _iSeverity = Nothing
549+ , _iDescription = Nothing
550+ }
551+
552+-- | Position of the issue in the \`Source\`.
553+iSourcePosition :: Lens' Issue (Maybe SourcePosition)
554+iSourcePosition
555+ = lens _iSourcePosition
556+ (\ s a -> s{_iSourcePosition = a})
557+
558+-- | The severity of the issue.
559+iSeverity :: Lens' Issue (Maybe IssueSeverity)
560+iSeverity
561+ = lens _iSeverity (\ s a -> s{_iSeverity = a})
562+
563+-- | Short error description.
564+iDescription :: Lens' Issue (Maybe Text)
565+iDescription
566+ = lens _iDescription (\ s a -> s{_iDescription = a})
567+
568+instance FromJSON Issue where
569+ parseJSON
570+ = withObject "Issue"
571+ (\ o ->
572+ Issue' <$>
573+ (o .:? "sourcePosition") <*> (o .:? "severity") <*>
574+ (o .:? "description"))
575+
576+instance ToJSON Issue where
577+ toJSON Issue'{..}
578+ = object
579+ (catMaybes
580+ [("sourcePosition" .=) <$> _iSourcePosition,
581+ ("severity" .=) <$> _iSeverity,
582+ ("description" .=) <$> _iDescription])
gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types/Sum.hsnew file+88
@@ -0,0 +1,88 @@
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.FirebaseRules.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.FirebaseRules.Types.Sum where
18+
19+import Network.Google.Prelude
20+
21+-- | V1 error format.
22+data Xgafv
23+ = X1
24+ -- ^ @1@
25+ -- v1 error format
26+ | X2
27+ -- ^ @2@
28+ -- v2 error format
29+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
30+
31+instance Hashable Xgafv
32+
33+instance FromHttpApiData Xgafv where
34+ parseQueryParam = \case
35+ "1" -> Right X1
36+ "2" -> Right X2
37+ x -> Left ("Unable to parse Xgafv from: " <> x)
38+
39+instance ToHttpApiData Xgafv where
40+ toQueryParam = \case
41+ X1 -> "1"
42+ X2 -> "2"
43+
44+instance FromJSON Xgafv where
45+ parseJSON = parseJSONText "Xgafv"
46+
47+instance ToJSON Xgafv where
48+ toJSON = toJSONText
49+
50+-- | The severity of the issue.
51+data IssueSeverity
52+ = SeverityUnspecified
53+ -- ^ @SEVERITY_UNSPECIFIED@
54+ -- An unspecified severity.
55+ | Deprecation
56+ -- ^ @DEPRECATION@
57+ -- Deprecation issue for statements and method that may no longer be
58+ -- supported or maintained.
59+ | Warning
60+ -- ^ @WARNING@
61+ -- Warnings such as: unused variables.
62+ | Error'
63+ -- ^ @ERROR@
64+ -- Errors such as: unmatched curly braces or variable redefinition.
65+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
66+
67+instance Hashable IssueSeverity
68+
69+instance FromHttpApiData IssueSeverity where
70+ parseQueryParam = \case
71+ "SEVERITY_UNSPECIFIED" -> Right SeverityUnspecified
72+ "DEPRECATION" -> Right Deprecation
73+ "WARNING" -> Right Warning
74+ "ERROR" -> Right Error'
75+ x -> Left ("Unable to parse IssueSeverity from: " <> x)
76+
77+instance ToHttpApiData IssueSeverity where
78+ toQueryParam = \case
79+ SeverityUnspecified -> "SEVERITY_UNSPECIFIED"
80+ Deprecation -> "DEPRECATION"
81+ Warning -> "WARNING"
82+ Error' -> "ERROR"
83+
84+instance FromJSON IssueSeverity where
85+ parseJSON = parseJSONText "IssueSeverity"
86+
87+instance ToJSON IssueSeverity where
88+ toJSON = toJSONText
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Create.hsnew file+218
@@ -0,0 +1,218 @@
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.FirebaseRules.Projects.Releases.Create
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+-- Create a \`Release\`. Release names should reflect the developer\'s
24+-- deployment practices. For example, the release name may include the
25+-- environment name, application name, application version, or any other
26+-- name meaningful to the developer. Once a \`Release\` refers to a
27+-- \`Ruleset\`, the rules can be enforced by Firebase Rules-enabled
28+-- services. More than one \`Release\` may be \'live\' concurrently.
29+-- Consider the following three \`Release\` names for \`projects\/foo\` and
30+-- the \`Ruleset\` to which they refer. Release Name | Ruleset Name
31+-- --------------------------------|-------------
32+-- projects\/foo\/releases\/prod | projects\/foo\/rulesets\/uuid123
33+-- projects\/foo\/releases\/prod\/beta | projects\/foo\/rulesets\/uuid123
34+-- projects\/foo\/releases\/prod\/v23 | projects\/foo\/rulesets\/uuid456
35+-- The table reflects the \`Ruleset\` rollout in progress. The \`prod\` and
36+-- \`prod\/beta\` releases refer to the same \`Ruleset\`. However,
37+-- \`prod\/v23\` refers to a new \`Ruleset\`. The \`Ruleset\` reference for
38+-- a \`Release\` may be updated using the UpdateRelease method, and the
39+-- custom \`Release\` name may be referenced by specifying the
40+-- \`X-Firebase-Rules-Release-Name\` header.
41+--
42+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.releases.create@.
43+module Network.Google.Resource.FirebaseRules.Projects.Releases.Create
44+ (
45+ -- * REST Resource
46+ ProjectsReleasesCreateResource
47+
48+ -- * Creating a Request
49+ , projectsReleasesCreate
50+ , ProjectsReleasesCreate
51+
52+ -- * Request Lenses
53+ , prcrXgafv
54+ , prcrUploadProtocol
55+ , prcrPp
56+ , prcrAccessToken
57+ , prcrUploadType
58+ , prcrPayload
59+ , prcrBearerToken
60+ , prcrName
61+ , prcrCallback
62+ ) where
63+
64+import Network.Google.FirebaseRules.Types
65+import Network.Google.Prelude
66+
67+-- | A resource alias for @firebaserules.projects.releases.create@ method which the
68+-- 'ProjectsReleasesCreate' request conforms to.
69+type ProjectsReleasesCreateResource =
70+ "v1" :>
71+ Capture "name" Text :>
72+ "releases" :>
73+ QueryParam "$.xgafv" Xgafv :>
74+ QueryParam "upload_protocol" Text :>
75+ QueryParam "pp" Bool :>
76+ QueryParam "access_token" Text :>
77+ QueryParam "uploadType" Text :>
78+ QueryParam "bearer_token" Text :>
79+ QueryParam "callback" Text :>
80+ QueryParam "alt" AltJSON :>
81+ ReqBody '[JSON] Release :> Post '[JSON] Release
82+
83+-- | Create a \`Release\`. Release names should reflect the developer\'s
84+-- deployment practices. For example, the release name may include the
85+-- environment name, application name, application version, or any other
86+-- name meaningful to the developer. Once a \`Release\` refers to a
87+-- \`Ruleset\`, the rules can be enforced by Firebase Rules-enabled
88+-- services. More than one \`Release\` may be \'live\' concurrently.
89+-- Consider the following three \`Release\` names for \`projects\/foo\` and
90+-- the \`Ruleset\` to which they refer. Release Name | Ruleset Name
91+-- --------------------------------|-------------
92+-- projects\/foo\/releases\/prod | projects\/foo\/rulesets\/uuid123
93+-- projects\/foo\/releases\/prod\/beta | projects\/foo\/rulesets\/uuid123
94+-- projects\/foo\/releases\/prod\/v23 | projects\/foo\/rulesets\/uuid456
95+-- The table reflects the \`Ruleset\` rollout in progress. The \`prod\` and
96+-- \`prod\/beta\` releases refer to the same \`Ruleset\`. However,
97+-- \`prod\/v23\` refers to a new \`Ruleset\`. The \`Ruleset\` reference for
98+-- a \`Release\` may be updated using the UpdateRelease method, and the
99+-- custom \`Release\` name may be referenced by specifying the
100+-- \`X-Firebase-Rules-Release-Name\` header.
101+--
102+-- /See:/ 'projectsReleasesCreate' smart constructor.
103+data ProjectsReleasesCreate = ProjectsReleasesCreate'
104+ { _prcrXgafv :: !(Maybe Xgafv)
105+ , _prcrUploadProtocol :: !(Maybe Text)
106+ , _prcrPp :: !Bool
107+ , _prcrAccessToken :: !(Maybe Text)
108+ , _prcrUploadType :: !(Maybe Text)
109+ , _prcrPayload :: !Release
110+ , _prcrBearerToken :: !(Maybe Text)
111+ , _prcrName :: !Text
112+ , _prcrCallback :: !(Maybe Text)
113+ } deriving (Eq,Show,Data,Typeable,Generic)
114+
115+-- | Creates a value of 'ProjectsReleasesCreate' with the minimum fields required to make a request.
116+--
117+-- Use one of the following lenses to modify other fields as desired:
118+--
119+-- * 'prcrXgafv'
120+--
121+-- * 'prcrUploadProtocol'
122+--
123+-- * 'prcrPp'
124+--
125+-- * 'prcrAccessToken'
126+--
127+-- * 'prcrUploadType'
128+--
129+-- * 'prcrPayload'
130+--
131+-- * 'prcrBearerToken'
132+--
133+-- * 'prcrName'
134+--
135+-- * 'prcrCallback'
136+projectsReleasesCreate
137+ :: Release -- ^ 'prcrPayload'
138+ -> Text -- ^ 'prcrName'
139+ -> ProjectsReleasesCreate
140+projectsReleasesCreate pPrcrPayload_ pPrcrName_ =
141+ ProjectsReleasesCreate'
142+ { _prcrXgafv = Nothing
143+ , _prcrUploadProtocol = Nothing
144+ , _prcrPp = True
145+ , _prcrAccessToken = Nothing
146+ , _prcrUploadType = Nothing
147+ , _prcrPayload = pPrcrPayload_
148+ , _prcrBearerToken = Nothing
149+ , _prcrName = pPrcrName_
150+ , _prcrCallback = Nothing
151+ }
152+
153+-- | V1 error format.
154+prcrXgafv :: Lens' ProjectsReleasesCreate (Maybe Xgafv)
155+prcrXgafv
156+ = lens _prcrXgafv (\ s a -> s{_prcrXgafv = a})
157+
158+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
159+prcrUploadProtocol :: Lens' ProjectsReleasesCreate (Maybe Text)
160+prcrUploadProtocol
161+ = lens _prcrUploadProtocol
162+ (\ s a -> s{_prcrUploadProtocol = a})
163+
164+-- | Pretty-print response.
165+prcrPp :: Lens' ProjectsReleasesCreate Bool
166+prcrPp = lens _prcrPp (\ s a -> s{_prcrPp = a})
167+
168+-- | OAuth access token.
169+prcrAccessToken :: Lens' ProjectsReleasesCreate (Maybe Text)
170+prcrAccessToken
171+ = lens _prcrAccessToken
172+ (\ s a -> s{_prcrAccessToken = a})
173+
174+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
175+prcrUploadType :: Lens' ProjectsReleasesCreate (Maybe Text)
176+prcrUploadType
177+ = lens _prcrUploadType
178+ (\ s a -> s{_prcrUploadType = a})
179+
180+-- | Multipart request metadata.
181+prcrPayload :: Lens' ProjectsReleasesCreate Release
182+prcrPayload
183+ = lens _prcrPayload (\ s a -> s{_prcrPayload = a})
184+
185+-- | OAuth bearer token.
186+prcrBearerToken :: Lens' ProjectsReleasesCreate (Maybe Text)
187+prcrBearerToken
188+ = lens _prcrBearerToken
189+ (\ s a -> s{_prcrBearerToken = a})
190+
191+-- | Resource name for the project which owns this \`Release\`. Format:
192+-- \`projects\/{project_id}\`
193+prcrName :: Lens' ProjectsReleasesCreate Text
194+prcrName = lens _prcrName (\ s a -> s{_prcrName = a})
195+
196+-- | JSONP
197+prcrCallback :: Lens' ProjectsReleasesCreate (Maybe Text)
198+prcrCallback
199+ = lens _prcrCallback (\ s a -> s{_prcrCallback = a})
200+
201+instance GoogleRequest ProjectsReleasesCreate where
202+ type Rs ProjectsReleasesCreate = Release
203+ type Scopes ProjectsReleasesCreate =
204+ '["https://www.googleapis.com/auth/cloud-platform"]
205+ requestClient ProjectsReleasesCreate'{..}
206+ = go _prcrName _prcrXgafv _prcrUploadProtocol
207+ (Just _prcrPp)
208+ _prcrAccessToken
209+ _prcrUploadType
210+ _prcrBearerToken
211+ _prcrCallback
212+ (Just AltJSON)
213+ _prcrPayload
214+ firebaseRulesService
215+ where go
216+ = buildClient
217+ (Proxy :: Proxy ProjectsReleasesCreateResource)
218+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Delete.hsnew file+169
@@ -0,0 +1,169 @@
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.FirebaseRules.Projects.Releases.Delete
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+-- Delete a \`Release\` by resource name.
24+--
25+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.releases.delete@.
26+module Network.Google.Resource.FirebaseRules.Projects.Releases.Delete
27+ (
28+ -- * REST Resource
29+ ProjectsReleasesDeleteResource
30+
31+ -- * Creating a Request
32+ , projectsReleasesDelete
33+ , ProjectsReleasesDelete
34+
35+ -- * Request Lenses
36+ , prdXgafv
37+ , prdUploadProtocol
38+ , prdPp
39+ , prdAccessToken
40+ , prdUploadType
41+ , prdBearerToken
42+ , prdName
43+ , prdCallback
44+ ) where
45+
46+import Network.Google.FirebaseRules.Types
47+import Network.Google.Prelude
48+
49+-- | A resource alias for @firebaserules.projects.releases.delete@ method which the
50+-- 'ProjectsReleasesDelete' request conforms to.
51+type ProjectsReleasesDeleteResource =
52+ "v1" :>
53+ Capture "name" Text :>
54+ QueryParam "$.xgafv" Xgafv :>
55+ QueryParam "upload_protocol" Text :>
56+ QueryParam "pp" Bool :>
57+ QueryParam "access_token" Text :>
58+ QueryParam "uploadType" Text :>
59+ QueryParam "bearer_token" Text :>
60+ QueryParam "callback" Text :>
61+ QueryParam "alt" AltJSON :> Delete '[JSON] Empty
62+
63+-- | Delete a \`Release\` by resource name.
64+--
65+-- /See:/ 'projectsReleasesDelete' smart constructor.
66+data ProjectsReleasesDelete = ProjectsReleasesDelete'
67+ { _prdXgafv :: !(Maybe Xgafv)
68+ , _prdUploadProtocol :: !(Maybe Text)
69+ , _prdPp :: !Bool
70+ , _prdAccessToken :: !(Maybe Text)
71+ , _prdUploadType :: !(Maybe Text)
72+ , _prdBearerToken :: !(Maybe Text)
73+ , _prdName :: !Text
74+ , _prdCallback :: !(Maybe Text)
75+ } deriving (Eq,Show,Data,Typeable,Generic)
76+
77+-- | Creates a value of 'ProjectsReleasesDelete' with the minimum fields required to make a request.
78+--
79+-- Use one of the following lenses to modify other fields as desired:
80+--
81+-- * 'prdXgafv'
82+--
83+-- * 'prdUploadProtocol'
84+--
85+-- * 'prdPp'
86+--
87+-- * 'prdAccessToken'
88+--
89+-- * 'prdUploadType'
90+--
91+-- * 'prdBearerToken'
92+--
93+-- * 'prdName'
94+--
95+-- * 'prdCallback'
96+projectsReleasesDelete
97+ :: Text -- ^ 'prdName'
98+ -> ProjectsReleasesDelete
99+projectsReleasesDelete pPrdName_ =
100+ ProjectsReleasesDelete'
101+ { _prdXgafv = Nothing
102+ , _prdUploadProtocol = Nothing
103+ , _prdPp = True
104+ , _prdAccessToken = Nothing
105+ , _prdUploadType = Nothing
106+ , _prdBearerToken = Nothing
107+ , _prdName = pPrdName_
108+ , _prdCallback = Nothing
109+ }
110+
111+-- | V1 error format.
112+prdXgafv :: Lens' ProjectsReleasesDelete (Maybe Xgafv)
113+prdXgafv = lens _prdXgafv (\ s a -> s{_prdXgafv = a})
114+
115+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
116+prdUploadProtocol :: Lens' ProjectsReleasesDelete (Maybe Text)
117+prdUploadProtocol
118+ = lens _prdUploadProtocol
119+ (\ s a -> s{_prdUploadProtocol = a})
120+
121+-- | Pretty-print response.
122+prdPp :: Lens' ProjectsReleasesDelete Bool
123+prdPp = lens _prdPp (\ s a -> s{_prdPp = a})
124+
125+-- | OAuth access token.
126+prdAccessToken :: Lens' ProjectsReleasesDelete (Maybe Text)
127+prdAccessToken
128+ = lens _prdAccessToken
129+ (\ s a -> s{_prdAccessToken = a})
130+
131+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
132+prdUploadType :: Lens' ProjectsReleasesDelete (Maybe Text)
133+prdUploadType
134+ = lens _prdUploadType
135+ (\ s a -> s{_prdUploadType = a})
136+
137+-- | OAuth bearer token.
138+prdBearerToken :: Lens' ProjectsReleasesDelete (Maybe Text)
139+prdBearerToken
140+ = lens _prdBearerToken
141+ (\ s a -> s{_prdBearerToken = a})
142+
143+-- | Resource name for the \`Release\` to delete. Format:
144+-- \`projects\/{project_id}\/releases\/{release_id}\`
145+prdName :: Lens' ProjectsReleasesDelete Text
146+prdName = lens _prdName (\ s a -> s{_prdName = a})
147+
148+-- | JSONP
149+prdCallback :: Lens' ProjectsReleasesDelete (Maybe Text)
150+prdCallback
151+ = lens _prdCallback (\ s a -> s{_prdCallback = a})
152+
153+instance GoogleRequest ProjectsReleasesDelete where
154+ type Rs ProjectsReleasesDelete = Empty
155+ type Scopes ProjectsReleasesDelete =
156+ '["https://www.googleapis.com/auth/cloud-platform"]
157+ requestClient ProjectsReleasesDelete'{..}
158+ = go _prdName _prdXgafv _prdUploadProtocol
159+ (Just _prdPp)
160+ _prdAccessToken
161+ _prdUploadType
162+ _prdBearerToken
163+ _prdCallback
164+ (Just AltJSON)
165+ firebaseRulesService
166+ where go
167+ = buildClient
168+ (Proxy :: Proxy ProjectsReleasesDeleteResource)
169+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Get.hsnew file+165
@@ -0,0 +1,165 @@
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.FirebaseRules.Projects.Releases.Get
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+-- Get a \`Release\` by name.
24+--
25+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.releases.get@.
26+module Network.Google.Resource.FirebaseRules.Projects.Releases.Get
27+ (
28+ -- * REST Resource
29+ ProjectsReleasesGetResource
30+
31+ -- * Creating a Request
32+ , projectsReleasesGet
33+ , ProjectsReleasesGet
34+
35+ -- * Request Lenses
36+ , pXgafv
37+ , pUploadProtocol
38+ , pPp
39+ , pAccessToken
40+ , pUploadType
41+ , pBearerToken
42+ , pName
43+ , pCallback
44+ ) where
45+
46+import Network.Google.FirebaseRules.Types
47+import Network.Google.Prelude
48+
49+-- | A resource alias for @firebaserules.projects.releases.get@ method which the
50+-- 'ProjectsReleasesGet' request conforms to.
51+type ProjectsReleasesGetResource =
52+ "v1" :>
53+ Capture "name" Text :>
54+ QueryParam "$.xgafv" Xgafv :>
55+ QueryParam "upload_protocol" Text :>
56+ QueryParam "pp" Bool :>
57+ QueryParam "access_token" Text :>
58+ QueryParam "uploadType" Text :>
59+ QueryParam "bearer_token" Text :>
60+ QueryParam "callback" Text :>
61+ QueryParam "alt" AltJSON :> Get '[JSON] Release
62+
63+-- | Get a \`Release\` by name.
64+--
65+-- /See:/ 'projectsReleasesGet' smart constructor.
66+data ProjectsReleasesGet = ProjectsReleasesGet'
67+ { _pXgafv :: !(Maybe Xgafv)
68+ , _pUploadProtocol :: !(Maybe Text)
69+ , _pPp :: !Bool
70+ , _pAccessToken :: !(Maybe Text)
71+ , _pUploadType :: !(Maybe Text)
72+ , _pBearerToken :: !(Maybe Text)
73+ , _pName :: !Text
74+ , _pCallback :: !(Maybe Text)
75+ } deriving (Eq,Show,Data,Typeable,Generic)
76+
77+-- | Creates a value of 'ProjectsReleasesGet' with the minimum fields required to make a request.
78+--
79+-- Use one of the following lenses to modify other fields as desired:
80+--
81+-- * 'pXgafv'
82+--
83+-- * 'pUploadProtocol'
84+--
85+-- * 'pPp'
86+--
87+-- * 'pAccessToken'
88+--
89+-- * 'pUploadType'
90+--
91+-- * 'pBearerToken'
92+--
93+-- * 'pName'
94+--
95+-- * 'pCallback'
96+projectsReleasesGet
97+ :: Text -- ^ 'pName'
98+ -> ProjectsReleasesGet
99+projectsReleasesGet pPName_ =
100+ ProjectsReleasesGet'
101+ { _pXgafv = Nothing
102+ , _pUploadProtocol = Nothing
103+ , _pPp = True
104+ , _pAccessToken = Nothing
105+ , _pUploadType = Nothing
106+ , _pBearerToken = Nothing
107+ , _pName = pPName_
108+ , _pCallback = Nothing
109+ }
110+
111+-- | V1 error format.
112+pXgafv :: Lens' ProjectsReleasesGet (Maybe Xgafv)
113+pXgafv = lens _pXgafv (\ s a -> s{_pXgafv = a})
114+
115+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
116+pUploadProtocol :: Lens' ProjectsReleasesGet (Maybe Text)
117+pUploadProtocol
118+ = lens _pUploadProtocol
119+ (\ s a -> s{_pUploadProtocol = a})
120+
121+-- | Pretty-print response.
122+pPp :: Lens' ProjectsReleasesGet Bool
123+pPp = lens _pPp (\ s a -> s{_pPp = a})
124+
125+-- | OAuth access token.
126+pAccessToken :: Lens' ProjectsReleasesGet (Maybe Text)
127+pAccessToken
128+ = lens _pAccessToken (\ s a -> s{_pAccessToken = a})
129+
130+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
131+pUploadType :: Lens' ProjectsReleasesGet (Maybe Text)
132+pUploadType
133+ = lens _pUploadType (\ s a -> s{_pUploadType = a})
134+
135+-- | OAuth bearer token.
136+pBearerToken :: Lens' ProjectsReleasesGet (Maybe Text)
137+pBearerToken
138+ = lens _pBearerToken (\ s a -> s{_pBearerToken = a})
139+
140+-- | Resource name of the \`Release\`. Format:
141+-- \`projects\/{project_id}\/releases\/{release_id}\`
142+pName :: Lens' ProjectsReleasesGet Text
143+pName = lens _pName (\ s a -> s{_pName = a})
144+
145+-- | JSONP
146+pCallback :: Lens' ProjectsReleasesGet (Maybe Text)
147+pCallback
148+ = lens _pCallback (\ s a -> s{_pCallback = a})
149+
150+instance GoogleRequest ProjectsReleasesGet where
151+ type Rs ProjectsReleasesGet = Release
152+ type Scopes ProjectsReleasesGet =
153+ '["https://www.googleapis.com/auth/cloud-platform"]
154+ requestClient ProjectsReleasesGet'{..}
155+ = go _pName _pXgafv _pUploadProtocol (Just _pPp)
156+ _pAccessToken
157+ _pUploadType
158+ _pBearerToken
159+ _pCallback
160+ (Just AltJSON)
161+ firebaseRulesService
162+ where go
163+ = buildClient
164+ (Proxy :: Proxy ProjectsReleasesGetResource)
165+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/List.hsnew file+232
@@ -0,0 +1,232 @@
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.FirebaseRules.Projects.Releases.List
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+-- List the \`Release\` values for a project. This list may optionally be
24+-- filtered by \`Release\` name or \`Ruleset\` id or both.
25+--
26+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.releases.list@.
27+module Network.Google.Resource.FirebaseRules.Projects.Releases.List
28+ (
29+ -- * REST Resource
30+ ProjectsReleasesListResource
31+
32+ -- * Creating a Request
33+ , projectsReleasesList
34+ , ProjectsReleasesList
35+
36+ -- * Request Lenses
37+ , prlrXgafv
38+ , prlrUploadProtocol
39+ , prlrPp
40+ , prlrAccessToken
41+ , prlrUploadType
42+ , prlrBearerToken
43+ , prlrName
44+ , prlrFilter
45+ , prlrPageToken
46+ , prlrPageSize
47+ , prlrCallback
48+ ) where
49+
50+import Network.Google.FirebaseRules.Types
51+import Network.Google.Prelude
52+
53+-- | A resource alias for @firebaserules.projects.releases.list@ method which the
54+-- 'ProjectsReleasesList' request conforms to.
55+type ProjectsReleasesListResource =
56+ "v1" :>
57+ Capture "name" Text :>
58+ "releases" :>
59+ QueryParam "$.xgafv" Xgafv :>
60+ QueryParam "upload_protocol" Text :>
61+ QueryParam "pp" Bool :>
62+ QueryParam "access_token" Text :>
63+ QueryParam "uploadType" Text :>
64+ QueryParam "bearer_token" Text :>
65+ QueryParam "filter" Text :>
66+ QueryParam "pageToken" Text :>
67+ QueryParam "pageSize" (Textual Int32) :>
68+ QueryParam "callback" Text :>
69+ QueryParam "alt" AltJSON :>
70+ Get '[JSON] ListReleasesResponse
71+
72+-- | List the \`Release\` values for a project. This list may optionally be
73+-- filtered by \`Release\` name or \`Ruleset\` id or both.
74+--
75+-- /See:/ 'projectsReleasesList' smart constructor.
76+data ProjectsReleasesList = ProjectsReleasesList'
77+ { _prlrXgafv :: !(Maybe Xgafv)
78+ , _prlrUploadProtocol :: !(Maybe Text)
79+ , _prlrPp :: !Bool
80+ , _prlrAccessToken :: !(Maybe Text)
81+ , _prlrUploadType :: !(Maybe Text)
82+ , _prlrBearerToken :: !(Maybe Text)
83+ , _prlrName :: !Text
84+ , _prlrFilter :: !(Maybe Text)
85+ , _prlrPageToken :: !(Maybe Text)
86+ , _prlrPageSize :: !(Maybe (Textual Int32))
87+ , _prlrCallback :: !(Maybe Text)
88+ } deriving (Eq,Show,Data,Typeable,Generic)
89+
90+-- | Creates a value of 'ProjectsReleasesList' 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+-- * 'prlrXgafv'
95+--
96+-- * 'prlrUploadProtocol'
97+--
98+-- * 'prlrPp'
99+--
100+-- * 'prlrAccessToken'
101+--
102+-- * 'prlrUploadType'
103+--
104+-- * 'prlrBearerToken'
105+--
106+-- * 'prlrName'
107+--
108+-- * 'prlrFilter'
109+--
110+-- * 'prlrPageToken'
111+--
112+-- * 'prlrPageSize'
113+--
114+-- * 'prlrCallback'
115+projectsReleasesList
116+ :: Text -- ^ 'prlrName'
117+ -> ProjectsReleasesList
118+projectsReleasesList pPrlrName_ =
119+ ProjectsReleasesList'
120+ { _prlrXgafv = Nothing
121+ , _prlrUploadProtocol = Nothing
122+ , _prlrPp = True
123+ , _prlrAccessToken = Nothing
124+ , _prlrUploadType = Nothing
125+ , _prlrBearerToken = Nothing
126+ , _prlrName = pPrlrName_
127+ , _prlrFilter = Nothing
128+ , _prlrPageToken = Nothing
129+ , _prlrPageSize = Nothing
130+ , _prlrCallback = Nothing
131+ }
132+
133+-- | V1 error format.
134+prlrXgafv :: Lens' ProjectsReleasesList (Maybe Xgafv)
135+prlrXgafv
136+ = lens _prlrXgafv (\ s a -> s{_prlrXgafv = a})
137+
138+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
139+prlrUploadProtocol :: Lens' ProjectsReleasesList (Maybe Text)
140+prlrUploadProtocol
141+ = lens _prlrUploadProtocol
142+ (\ s a -> s{_prlrUploadProtocol = a})
143+
144+-- | Pretty-print response.
145+prlrPp :: Lens' ProjectsReleasesList Bool
146+prlrPp = lens _prlrPp (\ s a -> s{_prlrPp = a})
147+
148+-- | OAuth access token.
149+prlrAccessToken :: Lens' ProjectsReleasesList (Maybe Text)
150+prlrAccessToken
151+ = lens _prlrAccessToken
152+ (\ s a -> s{_prlrAccessToken = a})
153+
154+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
155+prlrUploadType :: Lens' ProjectsReleasesList (Maybe Text)
156+prlrUploadType
157+ = lens _prlrUploadType
158+ (\ s a -> s{_prlrUploadType = a})
159+
160+-- | OAuth bearer token.
161+prlrBearerToken :: Lens' ProjectsReleasesList (Maybe Text)
162+prlrBearerToken
163+ = lens _prlrBearerToken
164+ (\ s a -> s{_prlrBearerToken = a})
165+
166+-- | Resource name for the project. Format: \`projects\/{project_id}\`
167+prlrName :: Lens' ProjectsReleasesList Text
168+prlrName = lens _prlrName (\ s a -> s{_prlrName = a})
169+
170+-- | \`Release\` filter. The list method supports filters with restrictions
171+-- on the \`Release\` \`name\` and also on the \`Ruleset\`
172+-- \`ruleset_name\`. Example 1) A filter of \'name=prod*\' might return
173+-- \`Release\`s with names within \'projects\/foo\' prefixed with \'prod\':
174+-- Name | Ruleset Name ------------------------------|-------------
175+-- projects\/foo\/releases\/prod | projects\/foo\/rulesets\/uuid1234
176+-- projects\/foo\/releases\/prod\/v1 | projects\/foo\/rulesets\/uuid1234
177+-- projects\/foo\/releases\/prod\/v2 | projects\/foo\/rulesets\/uuid8888
178+-- Example 2) A filter of \`name=prod* ruleset_name=uuid1234\` would return
179+-- only \`Release\` instances for \'projects\/foo\' with names prefixed
180+-- with \'prod\' referring to the same \`Ruleset\` name of \'uuid1234\':
181+-- Name | Ruleset Name ------------------------------|-------------
182+-- projects\/foo\/releases\/prod | projects\/foo\/rulesets\/1234
183+-- projects\/foo\/releases\/prod\/v1 | projects\/foo\/rulesets\/1234 In the
184+-- examples, the filter parameters refer to the search filters for release
185+-- and ruleset names are relative to the project releases and rulesets
186+-- collections. Fully qualified prefixed may also be used. e.g.
187+-- \`name=projects\/foo\/releases\/prod*
188+-- ruleset_name=projects\/foo\/rulesets\/uuid1\`
189+prlrFilter :: Lens' ProjectsReleasesList (Maybe Text)
190+prlrFilter
191+ = lens _prlrFilter (\ s a -> s{_prlrFilter = a})
192+
193+-- | Next page token for the next batch of \`Release\` instances.
194+prlrPageToken :: Lens' ProjectsReleasesList (Maybe Text)
195+prlrPageToken
196+ = lens _prlrPageToken
197+ (\ s a -> s{_prlrPageToken = a})
198+
199+-- | Page size to load. Maximum of 100. Defaults to 10. Note: \`page_size\`
200+-- is just a hint and the service may choose to load less than
201+-- \`page_size\` due to the size of the output. To traverse all of the
202+-- releases, caller should iterate until the \`page_token\` is empty.
203+prlrPageSize :: Lens' ProjectsReleasesList (Maybe Int32)
204+prlrPageSize
205+ = lens _prlrPageSize (\ s a -> s{_prlrPageSize = a})
206+ . mapping _Coerce
207+
208+-- | JSONP
209+prlrCallback :: Lens' ProjectsReleasesList (Maybe Text)
210+prlrCallback
211+ = lens _prlrCallback (\ s a -> s{_prlrCallback = a})
212+
213+instance GoogleRequest ProjectsReleasesList where
214+ type Rs ProjectsReleasesList = ListReleasesResponse
215+ type Scopes ProjectsReleasesList =
216+ '["https://www.googleapis.com/auth/cloud-platform"]
217+ requestClient ProjectsReleasesList'{..}
218+ = go _prlrName _prlrXgafv _prlrUploadProtocol
219+ (Just _prlrPp)
220+ _prlrAccessToken
221+ _prlrUploadType
222+ _prlrBearerToken
223+ _prlrFilter
224+ _prlrPageToken
225+ _prlrPageSize
226+ _prlrCallback
227+ (Just AltJSON)
228+ firebaseRulesService
229+ where go
230+ = buildClient
231+ (Proxy :: Proxy ProjectsReleasesListResource)
232+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Releases/Update.hsnew file+201
@@ -0,0 +1,201 @@
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.FirebaseRules.Projects.Releases.Update
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+-- Update a \`Release\`. Only updates to the \`ruleset_name\` field will be
24+-- honored. \`Release\` rename is not supported. To create a \`Release\`
25+-- use the CreateRelease method instead.
26+--
27+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.releases.update@.
28+module Network.Google.Resource.FirebaseRules.Projects.Releases.Update
29+ (
30+ -- * REST Resource
31+ ProjectsReleasesUpdateResource
32+
33+ -- * Creating a Request
34+ , projectsReleasesUpdate
35+ , ProjectsReleasesUpdate
36+
37+ -- * Request Lenses
38+ , pruXgafv
39+ , pruUploadProtocol
40+ , pruPp
41+ , pruAccessToken
42+ , pruUploadType
43+ , pruPayload
44+ , pruBearerToken
45+ , pruName
46+ , pruCallback
47+ ) where
48+
49+import Network.Google.FirebaseRules.Types
50+import Network.Google.Prelude
51+
52+-- | A resource alias for @firebaserules.projects.releases.update@ method which the
53+-- 'ProjectsReleasesUpdate' request conforms to.
54+type ProjectsReleasesUpdateResource =
55+ "v1" :>
56+ Capture "name" Text :>
57+ QueryParam "$.xgafv" Xgafv :>
58+ QueryParam "upload_protocol" Text :>
59+ QueryParam "pp" Bool :>
60+ QueryParam "access_token" Text :>
61+ QueryParam "uploadType" Text :>
62+ QueryParam "bearer_token" Text :>
63+ QueryParam "callback" Text :>
64+ QueryParam "alt" AltJSON :>
65+ ReqBody '[JSON] Release :> Put '[JSON] Release
66+
67+-- | Update a \`Release\`. Only updates to the \`ruleset_name\` field will be
68+-- honored. \`Release\` rename is not supported. To create a \`Release\`
69+-- use the CreateRelease method instead.
70+--
71+-- /See:/ 'projectsReleasesUpdate' smart constructor.
72+data ProjectsReleasesUpdate = ProjectsReleasesUpdate'
73+ { _pruXgafv :: !(Maybe Xgafv)
74+ , _pruUploadProtocol :: !(Maybe Text)
75+ , _pruPp :: !Bool
76+ , _pruAccessToken :: !(Maybe Text)
77+ , _pruUploadType :: !(Maybe Text)
78+ , _pruPayload :: !Release
79+ , _pruBearerToken :: !(Maybe Text)
80+ , _pruName :: !Text
81+ , _pruCallback :: !(Maybe Text)
82+ } deriving (Eq,Show,Data,Typeable,Generic)
83+
84+-- | Creates a value of 'ProjectsReleasesUpdate' with the minimum fields required to make a request.
85+--
86+-- Use one of the following lenses to modify other fields as desired:
87+--
88+-- * 'pruXgafv'
89+--
90+-- * 'pruUploadProtocol'
91+--
92+-- * 'pruPp'
93+--
94+-- * 'pruAccessToken'
95+--
96+-- * 'pruUploadType'
97+--
98+-- * 'pruPayload'
99+--
100+-- * 'pruBearerToken'
101+--
102+-- * 'pruName'
103+--
104+-- * 'pruCallback'
105+projectsReleasesUpdate
106+ :: Release -- ^ 'pruPayload'
107+ -> Text -- ^ 'pruName'
108+ -> ProjectsReleasesUpdate
109+projectsReleasesUpdate pPruPayload_ pPruName_ =
110+ ProjectsReleasesUpdate'
111+ { _pruXgafv = Nothing
112+ , _pruUploadProtocol = Nothing
113+ , _pruPp = True
114+ , _pruAccessToken = Nothing
115+ , _pruUploadType = Nothing
116+ , _pruPayload = pPruPayload_
117+ , _pruBearerToken = Nothing
118+ , _pruName = pPruName_
119+ , _pruCallback = Nothing
120+ }
121+
122+-- | V1 error format.
123+pruXgafv :: Lens' ProjectsReleasesUpdate (Maybe Xgafv)
124+pruXgafv = lens _pruXgafv (\ s a -> s{_pruXgafv = a})
125+
126+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
127+pruUploadProtocol :: Lens' ProjectsReleasesUpdate (Maybe Text)
128+pruUploadProtocol
129+ = lens _pruUploadProtocol
130+ (\ s a -> s{_pruUploadProtocol = a})
131+
132+-- | Pretty-print response.
133+pruPp :: Lens' ProjectsReleasesUpdate Bool
134+pruPp = lens _pruPp (\ s a -> s{_pruPp = a})
135+
136+-- | OAuth access token.
137+pruAccessToken :: Lens' ProjectsReleasesUpdate (Maybe Text)
138+pruAccessToken
139+ = lens _pruAccessToken
140+ (\ s a -> s{_pruAccessToken = a})
141+
142+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
143+pruUploadType :: Lens' ProjectsReleasesUpdate (Maybe Text)
144+pruUploadType
145+ = lens _pruUploadType
146+ (\ s a -> s{_pruUploadType = a})
147+
148+-- | Multipart request metadata.
149+pruPayload :: Lens' ProjectsReleasesUpdate Release
150+pruPayload
151+ = lens _pruPayload (\ s a -> s{_pruPayload = a})
152+
153+-- | OAuth bearer token.
154+pruBearerToken :: Lens' ProjectsReleasesUpdate (Maybe Text)
155+pruBearerToken
156+ = lens _pruBearerToken
157+ (\ s a -> s{_pruBearerToken = a})
158+
159+-- | Resource name for the \`Release\`. \`Release\` names may be structured
160+-- \`app1\/prod\/v2\` or flat \`app1_prod_v2\` which affords developers a
161+-- great deal of flexibility in mapping the name to the style that best
162+-- fits their existing development practices. For example, a name could
163+-- refer to an environment, an app, a version, or some combination of
164+-- three. In the table below, for the project name \`projects\/foo\`, the
165+-- following relative release paths show how flat and structured names
166+-- might be chosen to match a desired development \/ deployment strategy.
167+-- Use Case | Flat Name | Structured Name
168+-- -------------|---------------------|---------------- Environments |
169+-- releases\/qa | releases\/qa Apps | releases\/app1_qa |
170+-- releases\/app1\/qa Versions | releases\/app1_v2_qa |
171+-- releases\/app1\/v2\/qa The delimiter between the release name path
172+-- elements can be almost anything and it should work equally well with the
173+-- release name list filter, but in many ways the structured paths provide
174+-- a clearer picture of the relationship between \`Release\` instances.
175+-- Format: \`projects\/{project_id}\/releases\/{release_id}\`
176+pruName :: Lens' ProjectsReleasesUpdate Text
177+pruName = lens _pruName (\ s a -> s{_pruName = a})
178+
179+-- | JSONP
180+pruCallback :: Lens' ProjectsReleasesUpdate (Maybe Text)
181+pruCallback
182+ = lens _pruCallback (\ s a -> s{_pruCallback = a})
183+
184+instance GoogleRequest ProjectsReleasesUpdate where
185+ type Rs ProjectsReleasesUpdate = Release
186+ type Scopes ProjectsReleasesUpdate =
187+ '["https://www.googleapis.com/auth/cloud-platform"]
188+ requestClient ProjectsReleasesUpdate'{..}
189+ = go _pruName _pruXgafv _pruUploadProtocol
190+ (Just _pruPp)
191+ _pruAccessToken
192+ _pruUploadType
193+ _pruBearerToken
194+ _pruCallback
195+ (Just AltJSON)
196+ _pruPayload
197+ firebaseRulesService
198+ where go
199+ = buildClient
200+ (Proxy :: Proxy ProjectsReleasesUpdateResource)
201+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/Create.hsnew file+191
@@ -0,0 +1,191 @@
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.FirebaseRules.Projects.Rulesets.Create
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+-- Create a \`Ruleset\` from \`Source\`. The \`Ruleset\` is given a unique
24+-- generated name which is returned to the caller. \`Source\` containing
25+-- syntactic or semantics errors will result in an error response
26+-- indicating the first error encountered. For a detailed view of
27+-- \`Source\` issues, use TestRuleset.
28+--
29+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.rulesets.create@.
30+module Network.Google.Resource.FirebaseRules.Projects.Rulesets.Create
31+ (
32+ -- * REST Resource
33+ ProjectsRulesetsCreateResource
34+
35+ -- * Creating a Request
36+ , projectsRulesetsCreate
37+ , ProjectsRulesetsCreate
38+
39+ -- * Request Lenses
40+ , prcXgafv
41+ , prcUploadProtocol
42+ , prcPp
43+ , prcAccessToken
44+ , prcUploadType
45+ , prcPayload
46+ , prcBearerToken
47+ , prcName
48+ , prcCallback
49+ ) where
50+
51+import Network.Google.FirebaseRules.Types
52+import Network.Google.Prelude
53+
54+-- | A resource alias for @firebaserules.projects.rulesets.create@ method which the
55+-- 'ProjectsRulesetsCreate' request conforms to.
56+type ProjectsRulesetsCreateResource =
57+ "v1" :>
58+ Capture "name" Text :>
59+ "rulesets" :>
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] Ruleset :> Post '[JSON] Ruleset
69+
70+-- | Create a \`Ruleset\` from \`Source\`. The \`Ruleset\` is given a unique
71+-- generated name which is returned to the caller. \`Source\` containing
72+-- syntactic or semantics errors will result in an error response
73+-- indicating the first error encountered. For a detailed view of
74+-- \`Source\` issues, use TestRuleset.
75+--
76+-- /See:/ 'projectsRulesetsCreate' smart constructor.
77+data ProjectsRulesetsCreate = ProjectsRulesetsCreate'
78+ { _prcXgafv :: !(Maybe Xgafv)
79+ , _prcUploadProtocol :: !(Maybe Text)
80+ , _prcPp :: !Bool
81+ , _prcAccessToken :: !(Maybe Text)
82+ , _prcUploadType :: !(Maybe Text)
83+ , _prcPayload :: !Ruleset
84+ , _prcBearerToken :: !(Maybe Text)
85+ , _prcName :: !Text
86+ , _prcCallback :: !(Maybe Text)
87+ } deriving (Eq,Show,Data,Typeable,Generic)
88+
89+-- | Creates a value of 'ProjectsRulesetsCreate' with the minimum fields required to make a request.
90+--
91+-- Use one of the following lenses to modify other fields as desired:
92+--
93+-- * 'prcXgafv'
94+--
95+-- * 'prcUploadProtocol'
96+--
97+-- * 'prcPp'
98+--
99+-- * 'prcAccessToken'
100+--
101+-- * 'prcUploadType'
102+--
103+-- * 'prcPayload'
104+--
105+-- * 'prcBearerToken'
106+--
107+-- * 'prcName'
108+--
109+-- * 'prcCallback'
110+projectsRulesetsCreate
111+ :: Ruleset -- ^ 'prcPayload'
112+ -> Text -- ^ 'prcName'
113+ -> ProjectsRulesetsCreate
114+projectsRulesetsCreate pPrcPayload_ pPrcName_ =
115+ ProjectsRulesetsCreate'
116+ { _prcXgafv = Nothing
117+ , _prcUploadProtocol = Nothing
118+ , _prcPp = True
119+ , _prcAccessToken = Nothing
120+ , _prcUploadType = Nothing
121+ , _prcPayload = pPrcPayload_
122+ , _prcBearerToken = Nothing
123+ , _prcName = pPrcName_
124+ , _prcCallback = Nothing
125+ }
126+
127+-- | V1 error format.
128+prcXgafv :: Lens' ProjectsRulesetsCreate (Maybe Xgafv)
129+prcXgafv = lens _prcXgafv (\ s a -> s{_prcXgafv = a})
130+
131+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
132+prcUploadProtocol :: Lens' ProjectsRulesetsCreate (Maybe Text)
133+prcUploadProtocol
134+ = lens _prcUploadProtocol
135+ (\ s a -> s{_prcUploadProtocol = a})
136+
137+-- | Pretty-print response.
138+prcPp :: Lens' ProjectsRulesetsCreate Bool
139+prcPp = lens _prcPp (\ s a -> s{_prcPp = a})
140+
141+-- | OAuth access token.
142+prcAccessToken :: Lens' ProjectsRulesetsCreate (Maybe Text)
143+prcAccessToken
144+ = lens _prcAccessToken
145+ (\ s a -> s{_prcAccessToken = a})
146+
147+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
148+prcUploadType :: Lens' ProjectsRulesetsCreate (Maybe Text)
149+prcUploadType
150+ = lens _prcUploadType
151+ (\ s a -> s{_prcUploadType = a})
152+
153+-- | Multipart request metadata.
154+prcPayload :: Lens' ProjectsRulesetsCreate Ruleset
155+prcPayload
156+ = lens _prcPayload (\ s a -> s{_prcPayload = a})
157+
158+-- | OAuth bearer token.
159+prcBearerToken :: Lens' ProjectsRulesetsCreate (Maybe Text)
160+prcBearerToken
161+ = lens _prcBearerToken
162+ (\ s a -> s{_prcBearerToken = a})
163+
164+-- | Resource name for Project which owns this \`Ruleset\`. Format:
165+-- \`projects\/{project_id}\`
166+prcName :: Lens' ProjectsRulesetsCreate Text
167+prcName = lens _prcName (\ s a -> s{_prcName = a})
168+
169+-- | JSONP
170+prcCallback :: Lens' ProjectsRulesetsCreate (Maybe Text)
171+prcCallback
172+ = lens _prcCallback (\ s a -> s{_prcCallback = a})
173+
174+instance GoogleRequest ProjectsRulesetsCreate where
175+ type Rs ProjectsRulesetsCreate = Ruleset
176+ type Scopes ProjectsRulesetsCreate =
177+ '["https://www.googleapis.com/auth/cloud-platform"]
178+ requestClient ProjectsRulesetsCreate'{..}
179+ = go _prcName _prcXgafv _prcUploadProtocol
180+ (Just _prcPp)
181+ _prcAccessToken
182+ _prcUploadType
183+ _prcBearerToken
184+ _prcCallback
185+ (Just AltJSON)
186+ _prcPayload
187+ firebaseRulesService
188+ where go
189+ = buildClient
190+ (Proxy :: Proxy ProjectsRulesetsCreateResource)
191+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/Delete.hsnew file+171
@@ -0,0 +1,171 @@
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.FirebaseRules.Projects.Rulesets.Delete
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+-- Delete a \`Ruleset\` by resource name. If the \`Ruleset\` is referenced
24+-- by a \`Release\` the operation will fail.
25+--
26+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.rulesets.delete@.
27+module Network.Google.Resource.FirebaseRules.Projects.Rulesets.Delete
28+ (
29+ -- * REST Resource
30+ ProjectsRulesetsDeleteResource
31+
32+ -- * Creating a Request
33+ , projectsRulesetsDelete
34+ , ProjectsRulesetsDelete
35+
36+ -- * Request Lenses
37+ , proXgafv
38+ , proUploadProtocol
39+ , proPp
40+ , proAccessToken
41+ , proUploadType
42+ , proBearerToken
43+ , proName
44+ , proCallback
45+ ) where
46+
47+import Network.Google.FirebaseRules.Types
48+import Network.Google.Prelude
49+
50+-- | A resource alias for @firebaserules.projects.rulesets.delete@ method which the
51+-- 'ProjectsRulesetsDelete' request conforms to.
52+type ProjectsRulesetsDeleteResource =
53+ "v1" :>
54+ Capture "name" Text :>
55+ QueryParam "$.xgafv" Xgafv :>
56+ QueryParam "upload_protocol" Text :>
57+ QueryParam "pp" Bool :>
58+ QueryParam "access_token" Text :>
59+ QueryParam "uploadType" Text :>
60+ QueryParam "bearer_token" Text :>
61+ QueryParam "callback" Text :>
62+ QueryParam "alt" AltJSON :> Delete '[JSON] Empty
63+
64+-- | Delete a \`Ruleset\` by resource name. If the \`Ruleset\` is referenced
65+-- by a \`Release\` the operation will fail.
66+--
67+-- /See:/ 'projectsRulesetsDelete' smart constructor.
68+data ProjectsRulesetsDelete = ProjectsRulesetsDelete'
69+ { _proXgafv :: !(Maybe Xgafv)
70+ , _proUploadProtocol :: !(Maybe Text)
71+ , _proPp :: !Bool
72+ , _proAccessToken :: !(Maybe Text)
73+ , _proUploadType :: !(Maybe Text)
74+ , _proBearerToken :: !(Maybe Text)
75+ , _proName :: !Text
76+ , _proCallback :: !(Maybe Text)
77+ } deriving (Eq,Show,Data,Typeable,Generic)
78+
79+-- | Creates a value of 'ProjectsRulesetsDelete' with the minimum fields required to make a request.
80+--
81+-- Use one of the following lenses to modify other fields as desired:
82+--
83+-- * 'proXgafv'
84+--
85+-- * 'proUploadProtocol'
86+--
87+-- * 'proPp'
88+--
89+-- * 'proAccessToken'
90+--
91+-- * 'proUploadType'
92+--
93+-- * 'proBearerToken'
94+--
95+-- * 'proName'
96+--
97+-- * 'proCallback'
98+projectsRulesetsDelete
99+ :: Text -- ^ 'proName'
100+ -> ProjectsRulesetsDelete
101+projectsRulesetsDelete pProName_ =
102+ ProjectsRulesetsDelete'
103+ { _proXgafv = Nothing
104+ , _proUploadProtocol = Nothing
105+ , _proPp = True
106+ , _proAccessToken = Nothing
107+ , _proUploadType = Nothing
108+ , _proBearerToken = Nothing
109+ , _proName = pProName_
110+ , _proCallback = Nothing
111+ }
112+
113+-- | V1 error format.
114+proXgafv :: Lens' ProjectsRulesetsDelete (Maybe Xgafv)
115+proXgafv = lens _proXgafv (\ s a -> s{_proXgafv = a})
116+
117+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
118+proUploadProtocol :: Lens' ProjectsRulesetsDelete (Maybe Text)
119+proUploadProtocol
120+ = lens _proUploadProtocol
121+ (\ s a -> s{_proUploadProtocol = a})
122+
123+-- | Pretty-print response.
124+proPp :: Lens' ProjectsRulesetsDelete Bool
125+proPp = lens _proPp (\ s a -> s{_proPp = a})
126+
127+-- | OAuth access token.
128+proAccessToken :: Lens' ProjectsRulesetsDelete (Maybe Text)
129+proAccessToken
130+ = lens _proAccessToken
131+ (\ s a -> s{_proAccessToken = a})
132+
133+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
134+proUploadType :: Lens' ProjectsRulesetsDelete (Maybe Text)
135+proUploadType
136+ = lens _proUploadType
137+ (\ s a -> s{_proUploadType = a})
138+
139+-- | OAuth bearer token.
140+proBearerToken :: Lens' ProjectsRulesetsDelete (Maybe Text)
141+proBearerToken
142+ = lens _proBearerToken
143+ (\ s a -> s{_proBearerToken = a})
144+
145+-- | Resource name for the ruleset to delete. Format:
146+-- \`projects\/{project_id}\/rulesets\/{ruleset_id}\`
147+proName :: Lens' ProjectsRulesetsDelete Text
148+proName = lens _proName (\ s a -> s{_proName = a})
149+
150+-- | JSONP
151+proCallback :: Lens' ProjectsRulesetsDelete (Maybe Text)
152+proCallback
153+ = lens _proCallback (\ s a -> s{_proCallback = a})
154+
155+instance GoogleRequest ProjectsRulesetsDelete where
156+ type Rs ProjectsRulesetsDelete = Empty
157+ type Scopes ProjectsRulesetsDelete =
158+ '["https://www.googleapis.com/auth/cloud-platform"]
159+ requestClient ProjectsRulesetsDelete'{..}
160+ = go _proName _proXgafv _proUploadProtocol
161+ (Just _proPp)
162+ _proAccessToken
163+ _proUploadType
164+ _proBearerToken
165+ _proCallback
166+ (Just AltJSON)
167+ firebaseRulesService
168+ where go
169+ = buildClient
170+ (Proxy :: Proxy ProjectsRulesetsDeleteResource)
171+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/Get.hsnew file+169
@@ -0,0 +1,169 @@
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.FirebaseRules.Projects.Rulesets.Get
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+-- Get a \`Ruleset\` by name including the full \`Source\` contents.
24+--
25+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.rulesets.get@.
26+module Network.Google.Resource.FirebaseRules.Projects.Rulesets.Get
27+ (
28+ -- * REST Resource
29+ ProjectsRulesetsGetResource
30+
31+ -- * Creating a Request
32+ , projectsRulesetsGet
33+ , ProjectsRulesetsGet
34+
35+ -- * Request Lenses
36+ , prgXgafv
37+ , prgUploadProtocol
38+ , prgPp
39+ , prgAccessToken
40+ , prgUploadType
41+ , prgBearerToken
42+ , prgName
43+ , prgCallback
44+ ) where
45+
46+import Network.Google.FirebaseRules.Types
47+import Network.Google.Prelude
48+
49+-- | A resource alias for @firebaserules.projects.rulesets.get@ method which the
50+-- 'ProjectsRulesetsGet' request conforms to.
51+type ProjectsRulesetsGetResource =
52+ "v1" :>
53+ Capture "name" Text :>
54+ QueryParam "$.xgafv" Xgafv :>
55+ QueryParam "upload_protocol" Text :>
56+ QueryParam "pp" Bool :>
57+ QueryParam "access_token" Text :>
58+ QueryParam "uploadType" Text :>
59+ QueryParam "bearer_token" Text :>
60+ QueryParam "callback" Text :>
61+ QueryParam "alt" AltJSON :> Get '[JSON] Ruleset
62+
63+-- | Get a \`Ruleset\` by name including the full \`Source\` contents.
64+--
65+-- /See:/ 'projectsRulesetsGet' smart constructor.
66+data ProjectsRulesetsGet = ProjectsRulesetsGet'
67+ { _prgXgafv :: !(Maybe Xgafv)
68+ , _prgUploadProtocol :: !(Maybe Text)
69+ , _prgPp :: !Bool
70+ , _prgAccessToken :: !(Maybe Text)
71+ , _prgUploadType :: !(Maybe Text)
72+ , _prgBearerToken :: !(Maybe Text)
73+ , _prgName :: !Text
74+ , _prgCallback :: !(Maybe Text)
75+ } deriving (Eq,Show,Data,Typeable,Generic)
76+
77+-- | Creates a value of 'ProjectsRulesetsGet' with the minimum fields required to make a request.
78+--
79+-- Use one of the following lenses to modify other fields as desired:
80+--
81+-- * 'prgXgafv'
82+--
83+-- * 'prgUploadProtocol'
84+--
85+-- * 'prgPp'
86+--
87+-- * 'prgAccessToken'
88+--
89+-- * 'prgUploadType'
90+--
91+-- * 'prgBearerToken'
92+--
93+-- * 'prgName'
94+--
95+-- * 'prgCallback'
96+projectsRulesetsGet
97+ :: Text -- ^ 'prgName'
98+ -> ProjectsRulesetsGet
99+projectsRulesetsGet pPrgName_ =
100+ ProjectsRulesetsGet'
101+ { _prgXgafv = Nothing
102+ , _prgUploadProtocol = Nothing
103+ , _prgPp = True
104+ , _prgAccessToken = Nothing
105+ , _prgUploadType = Nothing
106+ , _prgBearerToken = Nothing
107+ , _prgName = pPrgName_
108+ , _prgCallback = Nothing
109+ }
110+
111+-- | V1 error format.
112+prgXgafv :: Lens' ProjectsRulesetsGet (Maybe Xgafv)
113+prgXgafv = lens _prgXgafv (\ s a -> s{_prgXgafv = a})
114+
115+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
116+prgUploadProtocol :: Lens' ProjectsRulesetsGet (Maybe Text)
117+prgUploadProtocol
118+ = lens _prgUploadProtocol
119+ (\ s a -> s{_prgUploadProtocol = a})
120+
121+-- | Pretty-print response.
122+prgPp :: Lens' ProjectsRulesetsGet Bool
123+prgPp = lens _prgPp (\ s a -> s{_prgPp = a})
124+
125+-- | OAuth access token.
126+prgAccessToken :: Lens' ProjectsRulesetsGet (Maybe Text)
127+prgAccessToken
128+ = lens _prgAccessToken
129+ (\ s a -> s{_prgAccessToken = a})
130+
131+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
132+prgUploadType :: Lens' ProjectsRulesetsGet (Maybe Text)
133+prgUploadType
134+ = lens _prgUploadType
135+ (\ s a -> s{_prgUploadType = a})
136+
137+-- | OAuth bearer token.
138+prgBearerToken :: Lens' ProjectsRulesetsGet (Maybe Text)
139+prgBearerToken
140+ = lens _prgBearerToken
141+ (\ s a -> s{_prgBearerToken = a})
142+
143+-- | Resource name for the ruleset to get. Format:
144+-- \`projects\/{project_id}\/rulesets\/{ruleset_id}\`
145+prgName :: Lens' ProjectsRulesetsGet Text
146+prgName = lens _prgName (\ s a -> s{_prgName = a})
147+
148+-- | JSONP
149+prgCallback :: Lens' ProjectsRulesetsGet (Maybe Text)
150+prgCallback
151+ = lens _prgCallback (\ s a -> s{_prgCallback = a})
152+
153+instance GoogleRequest ProjectsRulesetsGet where
154+ type Rs ProjectsRulesetsGet = Ruleset
155+ type Scopes ProjectsRulesetsGet =
156+ '["https://www.googleapis.com/auth/cloud-platform"]
157+ requestClient ProjectsRulesetsGet'{..}
158+ = go _prgName _prgXgafv _prgUploadProtocol
159+ (Just _prgPp)
160+ _prgAccessToken
161+ _prgUploadType
162+ _prgBearerToken
163+ _prgCallback
164+ (Just AltJSON)
165+ firebaseRulesService
166+ where go
167+ = buildClient
168+ (Proxy :: Proxy ProjectsRulesetsGetResource)
169+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/List.hsnew file+202
@@ -0,0 +1,202 @@
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.FirebaseRules.Projects.Rulesets.List
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+-- List \`Ruleset\` metadata only and optionally filter the results by
24+-- Ruleset name. The full \`Source\` contents of a \`Ruleset\` may be
25+-- retrieved with GetRuleset.
26+--
27+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.rulesets.list@.
28+module Network.Google.Resource.FirebaseRules.Projects.Rulesets.List
29+ (
30+ -- * REST Resource
31+ ProjectsRulesetsListResource
32+
33+ -- * Creating a Request
34+ , projectsRulesetsList
35+ , ProjectsRulesetsList
36+
37+ -- * Request Lenses
38+ , prlXgafv
39+ , prlUploadProtocol
40+ , prlPp
41+ , prlAccessToken
42+ , prlUploadType
43+ , prlBearerToken
44+ , prlName
45+ , prlPageToken
46+ , prlPageSize
47+ , prlCallback
48+ ) where
49+
50+import Network.Google.FirebaseRules.Types
51+import Network.Google.Prelude
52+
53+-- | A resource alias for @firebaserules.projects.rulesets.list@ method which the
54+-- 'ProjectsRulesetsList' request conforms to.
55+type ProjectsRulesetsListResource =
56+ "v1" :>
57+ Capture "name" Text :>
58+ "rulesets" :>
59+ QueryParam "$.xgafv" Xgafv :>
60+ QueryParam "upload_protocol" Text :>
61+ QueryParam "pp" Bool :>
62+ QueryParam "access_token" Text :>
63+ QueryParam "uploadType" Text :>
64+ QueryParam "bearer_token" Text :>
65+ QueryParam "pageToken" Text :>
66+ QueryParam "pageSize" (Textual Int32) :>
67+ QueryParam "callback" Text :>
68+ QueryParam "alt" AltJSON :>
69+ Get '[JSON] ListRulesetsResponse
70+
71+-- | List \`Ruleset\` metadata only and optionally filter the results by
72+-- Ruleset name. The full \`Source\` contents of a \`Ruleset\` may be
73+-- retrieved with GetRuleset.
74+--
75+-- /See:/ 'projectsRulesetsList' smart constructor.
76+data ProjectsRulesetsList = ProjectsRulesetsList'
77+ { _prlXgafv :: !(Maybe Xgafv)
78+ , _prlUploadProtocol :: !(Maybe Text)
79+ , _prlPp :: !Bool
80+ , _prlAccessToken :: !(Maybe Text)
81+ , _prlUploadType :: !(Maybe Text)
82+ , _prlBearerToken :: !(Maybe Text)
83+ , _prlName :: !Text
84+ , _prlPageToken :: !(Maybe Text)
85+ , _prlPageSize :: !(Maybe (Textual Int32))
86+ , _prlCallback :: !(Maybe Text)
87+ } deriving (Eq,Show,Data,Typeable,Generic)
88+
89+-- | Creates a value of 'ProjectsRulesetsList' with the minimum fields required to make a request.
90+--
91+-- Use one of the following lenses to modify other fields as desired:
92+--
93+-- * 'prlXgafv'
94+--
95+-- * 'prlUploadProtocol'
96+--
97+-- * 'prlPp'
98+--
99+-- * 'prlAccessToken'
100+--
101+-- * 'prlUploadType'
102+--
103+-- * 'prlBearerToken'
104+--
105+-- * 'prlName'
106+--
107+-- * 'prlPageToken'
108+--
109+-- * 'prlPageSize'
110+--
111+-- * 'prlCallback'
112+projectsRulesetsList
113+ :: Text -- ^ 'prlName'
114+ -> ProjectsRulesetsList
115+projectsRulesetsList pPrlName_ =
116+ ProjectsRulesetsList'
117+ { _prlXgafv = Nothing
118+ , _prlUploadProtocol = Nothing
119+ , _prlPp = True
120+ , _prlAccessToken = Nothing
121+ , _prlUploadType = Nothing
122+ , _prlBearerToken = Nothing
123+ , _prlName = pPrlName_
124+ , _prlPageToken = Nothing
125+ , _prlPageSize = Nothing
126+ , _prlCallback = Nothing
127+ }
128+
129+-- | V1 error format.
130+prlXgafv :: Lens' ProjectsRulesetsList (Maybe Xgafv)
131+prlXgafv = lens _prlXgafv (\ s a -> s{_prlXgafv = a})
132+
133+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
134+prlUploadProtocol :: Lens' ProjectsRulesetsList (Maybe Text)
135+prlUploadProtocol
136+ = lens _prlUploadProtocol
137+ (\ s a -> s{_prlUploadProtocol = a})
138+
139+-- | Pretty-print response.
140+prlPp :: Lens' ProjectsRulesetsList Bool
141+prlPp = lens _prlPp (\ s a -> s{_prlPp = a})
142+
143+-- | OAuth access token.
144+prlAccessToken :: Lens' ProjectsRulesetsList (Maybe Text)
145+prlAccessToken
146+ = lens _prlAccessToken
147+ (\ s a -> s{_prlAccessToken = a})
148+
149+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
150+prlUploadType :: Lens' ProjectsRulesetsList (Maybe Text)
151+prlUploadType
152+ = lens _prlUploadType
153+ (\ s a -> s{_prlUploadType = a})
154+
155+-- | OAuth bearer token.
156+prlBearerToken :: Lens' ProjectsRulesetsList (Maybe Text)
157+prlBearerToken
158+ = lens _prlBearerToken
159+ (\ s a -> s{_prlBearerToken = a})
160+
161+-- | Resource name for the project. Format: \`projects\/{project_id}\`
162+prlName :: Lens' ProjectsRulesetsList Text
163+prlName = lens _prlName (\ s a -> s{_prlName = a})
164+
165+-- | Next page token for loading the next batch of \`Ruleset\` instances.
166+prlPageToken :: Lens' ProjectsRulesetsList (Maybe Text)
167+prlPageToken
168+ = lens _prlPageToken (\ s a -> s{_prlPageToken = a})
169+
170+-- | Page size to load. Maximum of 100. Defaults to 10. Note: \`page_size\`
171+-- is just a hint and the service may choose to load less than
172+-- \`page_size\` due to the size of the output. To traverse all of the
173+-- releases, caller should iterate until the \`page_token\` is empty.
174+prlPageSize :: Lens' ProjectsRulesetsList (Maybe Int32)
175+prlPageSize
176+ = lens _prlPageSize (\ s a -> s{_prlPageSize = a}) .
177+ mapping _Coerce
178+
179+-- | JSONP
180+prlCallback :: Lens' ProjectsRulesetsList (Maybe Text)
181+prlCallback
182+ = lens _prlCallback (\ s a -> s{_prlCallback = a})
183+
184+instance GoogleRequest ProjectsRulesetsList where
185+ type Rs ProjectsRulesetsList = ListRulesetsResponse
186+ type Scopes ProjectsRulesetsList =
187+ '["https://www.googleapis.com/auth/cloud-platform"]
188+ requestClient ProjectsRulesetsList'{..}
189+ = go _prlName _prlXgafv _prlUploadProtocol
190+ (Just _prlPp)
191+ _prlAccessToken
192+ _prlUploadType
193+ _prlBearerToken
194+ _prlPageToken
195+ _prlPageSize
196+ _prlCallback
197+ (Just AltJSON)
198+ firebaseRulesService
199+ where go
200+ = buildClient
201+ (Proxy :: Proxy ProjectsRulesetsListResource)
202+ mempty
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Test.hsnew file+205
@@ -0,0 +1,205 @@
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.FirebaseRules.Projects.Test
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+-- Test \`Source\` for syntactic and semantic correctness. Issues present
24+-- in the rules, if any, will be returned to the caller with a description,
25+-- severity, and source location. The test method will typically be
26+-- executed with a developer provided \`Source\`, but if regression testing
27+-- is desired, this method may be executed against a \`Ruleset\` resource
28+-- name and the \`Source\` will be retrieved from the persisted
29+-- \`Ruleset\`. The following is an example of \`Source\` that permits
30+-- users to upload images to a bucket bearing their user id and matching
31+-- the correct metadata: _*Example*_ \/\/ Users are allowed to subscribe
32+-- and unsubscribe to the blog. service firebase.storage { match
33+-- \/users\/{userId}\/images\/{imageName} { allow write: if userId ==
34+-- request.userId && (imageName.endsWith(\'.png\') ||
35+-- imageName.endsWith(\'.jpg\')) &&
36+-- resource.mimeType.startsWith(\'image\/\') } }
37+--
38+-- /See:/ <https://firebase.google.com/docs/storage/security/start Firebase Rules API Reference> for @firebaserules.projects.test@.
39+module Network.Google.Resource.FirebaseRules.Projects.Test
40+ (
41+ -- * REST Resource
42+ ProjectsTestResource
43+
44+ -- * Creating a Request
45+ , projectsTest
46+ , ProjectsTest
47+
48+ -- * Request Lenses
49+ , ptXgafv
50+ , ptUploadProtocol
51+ , ptPp
52+ , ptAccessToken
53+ , ptUploadType
54+ , ptPayload
55+ , ptBearerToken
56+ , ptName
57+ , ptCallback
58+ ) where
59+
60+import Network.Google.FirebaseRules.Types
61+import Network.Google.Prelude
62+
63+-- | A resource alias for @firebaserules.projects.test@ method which the
64+-- 'ProjectsTest' request conforms to.
65+type ProjectsTestResource =
66+ "v1" :>
67+ CaptureMode "name" "test" Text :>
68+ QueryParam "$.xgafv" Xgafv :>
69+ QueryParam "upload_protocol" Text :>
70+ QueryParam "pp" Bool :>
71+ QueryParam "access_token" Text :>
72+ QueryParam "uploadType" Text :>
73+ QueryParam "bearer_token" Text :>
74+ QueryParam "callback" Text :>
75+ QueryParam "alt" AltJSON :>
76+ ReqBody '[JSON] TestRulesetRequest :>
77+ Post '[JSON] TestRulesetResponse
78+
79+-- | Test \`Source\` for syntactic and semantic correctness. Issues present
80+-- in the rules, if any, will be returned to the caller with a description,
81+-- severity, and source location. The test method will typically be
82+-- executed with a developer provided \`Source\`, but if regression testing
83+-- is desired, this method may be executed against a \`Ruleset\` resource
84+-- name and the \`Source\` will be retrieved from the persisted
85+-- \`Ruleset\`. The following is an example of \`Source\` that permits
86+-- users to upload images to a bucket bearing their user id and matching
87+-- the correct metadata: _*Example*_ \/\/ Users are allowed to subscribe
88+-- and unsubscribe to the blog. service firebase.storage { match
89+-- \/users\/{userId}\/images\/{imageName} { allow write: if userId ==
90+-- request.userId && (imageName.endsWith(\'.png\') ||
91+-- imageName.endsWith(\'.jpg\')) &&
92+-- resource.mimeType.startsWith(\'image\/\') } }
93+--
94+-- /See:/ 'projectsTest' smart constructor.
95+data ProjectsTest = ProjectsTest'
96+ { _ptXgafv :: !(Maybe Xgafv)
97+ , _ptUploadProtocol :: !(Maybe Text)
98+ , _ptPp :: !Bool
99+ , _ptAccessToken :: !(Maybe Text)
100+ , _ptUploadType :: !(Maybe Text)
101+ , _ptPayload :: !TestRulesetRequest
102+ , _ptBearerToken :: !(Maybe Text)
103+ , _ptName :: !Text
104+ , _ptCallback :: !(Maybe Text)
105+ } deriving (Eq,Show,Data,Typeable,Generic)
106+
107+-- | Creates a value of 'ProjectsTest' with the minimum fields required to make a request.
108+--
109+-- Use one of the following lenses to modify other fields as desired:
110+--
111+-- * 'ptXgafv'
112+--
113+-- * 'ptUploadProtocol'
114+--
115+-- * 'ptPp'
116+--
117+-- * 'ptAccessToken'
118+--
119+-- * 'ptUploadType'
120+--
121+-- * 'ptPayload'
122+--
123+-- * 'ptBearerToken'
124+--
125+-- * 'ptName'
126+--
127+-- * 'ptCallback'
128+projectsTest
129+ :: TestRulesetRequest -- ^ 'ptPayload'
130+ -> Text -- ^ 'ptName'
131+ -> ProjectsTest
132+projectsTest pPtPayload_ pPtName_ =
133+ ProjectsTest'
134+ { _ptXgafv = Nothing
135+ , _ptUploadProtocol = Nothing
136+ , _ptPp = True
137+ , _ptAccessToken = Nothing
138+ , _ptUploadType = Nothing
139+ , _ptPayload = pPtPayload_
140+ , _ptBearerToken = Nothing
141+ , _ptName = pPtName_
142+ , _ptCallback = Nothing
143+ }
144+
145+-- | V1 error format.
146+ptXgafv :: Lens' ProjectsTest (Maybe Xgafv)
147+ptXgafv = lens _ptXgafv (\ s a -> s{_ptXgafv = a})
148+
149+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
150+ptUploadProtocol :: Lens' ProjectsTest (Maybe Text)
151+ptUploadProtocol
152+ = lens _ptUploadProtocol
153+ (\ s a -> s{_ptUploadProtocol = a})
154+
155+-- | Pretty-print response.
156+ptPp :: Lens' ProjectsTest Bool
157+ptPp = lens _ptPp (\ s a -> s{_ptPp = a})
158+
159+-- | OAuth access token.
160+ptAccessToken :: Lens' ProjectsTest (Maybe Text)
161+ptAccessToken
162+ = lens _ptAccessToken
163+ (\ s a -> s{_ptAccessToken = a})
164+
165+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
166+ptUploadType :: Lens' ProjectsTest (Maybe Text)
167+ptUploadType
168+ = lens _ptUploadType (\ s a -> s{_ptUploadType = a})
169+
170+-- | Multipart request metadata.
171+ptPayload :: Lens' ProjectsTest TestRulesetRequest
172+ptPayload
173+ = lens _ptPayload (\ s a -> s{_ptPayload = a})
174+
175+-- | OAuth bearer token.
176+ptBearerToken :: Lens' ProjectsTest (Maybe Text)
177+ptBearerToken
178+ = lens _ptBearerToken
179+ (\ s a -> s{_ptBearerToken = a})
180+
181+-- | Name of the project. Format: \`projects\/{project_id}\`
182+ptName :: Lens' ProjectsTest Text
183+ptName = lens _ptName (\ s a -> s{_ptName = a})
184+
185+-- | JSONP
186+ptCallback :: Lens' ProjectsTest (Maybe Text)
187+ptCallback
188+ = lens _ptCallback (\ s a -> s{_ptCallback = a})
189+
190+instance GoogleRequest ProjectsTest where
191+ type Rs ProjectsTest = TestRulesetResponse
192+ type Scopes ProjectsTest =
193+ '["https://www.googleapis.com/auth/cloud-platform"]
194+ requestClient ProjectsTest'{..}
195+ = go _ptName _ptXgafv _ptUploadProtocol (Just _ptPp)
196+ _ptAccessToken
197+ _ptUploadType
198+ _ptBearerToken
199+ _ptCallback
200+ (Just AltJSON)
201+ _ptPayload
202+ firebaseRulesService
203+ where go
204+ = buildClient (Proxy :: Proxy ProjectsTestResource)
205+ mempty
gogol-firebase-rules/gogol-firebase-rules.cabalnew file+56
@@ -0,0 +1,56 @@
1+name: gogol-firebase-rules
2+version: 0.0.1
3+synopsis: Google Firebase Rules 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+ Creates and manages rules that determine when a Firebase Rules-enabled
18+ service should permit a request.
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.FirebaseRules
38+ , Network.Google.FirebaseRules.Types
39+ , Network.Google.Resource.FirebaseRules.Projects.Releases.Create
40+ , Network.Google.Resource.FirebaseRules.Projects.Releases.Delete
41+ , Network.Google.Resource.FirebaseRules.Projects.Releases.Get
42+ , Network.Google.Resource.FirebaseRules.Projects.Releases.List
43+ , Network.Google.Resource.FirebaseRules.Projects.Releases.Update
44+ , Network.Google.Resource.FirebaseRules.Projects.Rulesets.Create
45+ , Network.Google.Resource.FirebaseRules.Projects.Rulesets.Delete
46+ , Network.Google.Resource.FirebaseRules.Projects.Rulesets.Get
47+ , Network.Google.Resource.FirebaseRules.Projects.Rulesets.List
48+ , Network.Google.Resource.FirebaseRules.Projects.Test
49+
50+ other-modules:
51+ Network.Google.FirebaseRules.Types.Product
52+ , Network.Google.FirebaseRules.Types.Sum
53+
54+ build-depends:
55+ gogol-core == 0.0.1.*
56+ , base >= 4.7
gogol-firebase-rules/src/.gitkeepnew file

No changes to the content.