Copyright | (c) 2015-2016 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Test `Source` for syntactic and semantic correctness. Issues present, if any, will be returned to the caller with a description, severity, and source location. The test method may be executed with `Source` or a `Ruleset` name. Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` name is useful for regression testing an existing rule. The following is an example of `Source` that permits users to upload images to a bucket bearing their user id and matching the correct metadata: _*Example*_ // Users are allowed to subscribe and unsubscribe to the blog. service firebase.storage { match /users/{userId}/images/{imageName} { allow write: if userId == request.auth.uid && (imageName.matches('*.png′)||imageName.matches(′ * .jpg')) && resource.mimeType.matches('^image/') } }
See: Firebase Rules API Reference for firebaserules.projects.test
.
Synopsis
- type ProjectsTestResource = "v1" :> (CaptureMode "name" "test" Text :> (QueryParam "$.xgafv" Xgafv :> (QueryParam "upload_protocol" Text :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "callback" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] TestRulesetRequest :> Post '[JSON] TestRulesetResponse))))))))
- projectsTest :: TestRulesetRequest -> Text -> ProjectsTest
- data ProjectsTest
- ptXgafv :: Lens' ProjectsTest (Maybe Xgafv)
- ptUploadProtocol :: Lens' ProjectsTest (Maybe Text)
- ptAccessToken :: Lens' ProjectsTest (Maybe Text)
- ptUploadType :: Lens' ProjectsTest (Maybe Text)
- ptPayload :: Lens' ProjectsTest TestRulesetRequest
- ptName :: Lens' ProjectsTest Text
- ptCallback :: Lens' ProjectsTest (Maybe Text)
REST Resource
type ProjectsTestResource = "v1" :> (CaptureMode "name" "test" Text :> (QueryParam "$.xgafv" Xgafv :> (QueryParam "upload_protocol" Text :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "callback" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] TestRulesetRequest :> Post '[JSON] TestRulesetResponse)))))))) Source #
A resource alias for firebaserules.projects.test
method which the
ProjectsTest
request conforms to.
Creating a Request
Creates a value of ProjectsTest
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
data ProjectsTest Source #
Test `Source` for syntactic and semantic correctness. Issues present, if any, will be returned to the caller with a description, severity, and source location. The test method may be executed with `Source` or a `Ruleset` name. Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` name is useful for regression testing an existing rule. The following is an example of `Source` that permits users to upload images to a bucket bearing their user id and matching the correct metadata: _*Example*_ // Users are allowed to subscribe and unsubscribe to the blog. service firebase.storage { match /users/{userId}/images/{imageName} { allow write: if userId == request.auth.uid && (imageName.matches('*.png′)||imageName.matches(′ * .jpg')) && resource.mimeType.matches('^image/') } }
See: projectsTest
smart constructor.
Instances
Request Lenses
ptUploadProtocol :: Lens' ProjectsTest (Maybe Text) Source #
Upload protocol for media (e.g. "raw", "multipart").
ptAccessToken :: Lens' ProjectsTest (Maybe Text) Source #
OAuth access token.
ptUploadType :: Lens' ProjectsTest (Maybe Text) Source #
Legacy upload protocol for media (e.g. "media", "multipart").
ptPayload :: Lens' ProjectsTest TestRulesetRequest Source #
Multipart request metadata.
ptName :: Lens' ProjectsTest Text Source #
Tests may either provide `source` or a `Ruleset` resource name. For tests against `source`, the resource name must refer to the project: Format: `projects/{project_id}` For tests against a `Ruleset`, this must be the `Ruleset` resource name: Format: `projects/{project_id}/rulesets/{ruleset_id}`
ptCallback :: Lens' ProjectsTest (Maybe Text) Source #
JSONP