gogol-firebase-rules-0.4.0: Google Firebase Rules SDK.

Copyright(c) 2015-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.Google.Resource.FirebaseRules.Projects.Test

Contents

Description

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

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

projectsTest Source #

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
Eq ProjectsTest Source # 
Instance details

Defined in Network.Google.Resource.FirebaseRules.Projects.Test

Data ProjectsTest Source # 
Instance details

Defined in Network.Google.Resource.FirebaseRules.Projects.Test

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ProjectsTest -> c ProjectsTest #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ProjectsTest #

toConstr :: ProjectsTest -> Constr #

dataTypeOf :: ProjectsTest -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ProjectsTest) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ProjectsTest) #

gmapT :: (forall b. Data b => b -> b) -> ProjectsTest -> ProjectsTest #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ProjectsTest -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ProjectsTest -> r #

gmapQ :: (forall d. Data d => d -> u) -> ProjectsTest -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ProjectsTest -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ProjectsTest -> m ProjectsTest #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ProjectsTest -> m ProjectsTest #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ProjectsTest -> m ProjectsTest #

Show ProjectsTest Source # 
Instance details

Defined in Network.Google.Resource.FirebaseRules.Projects.Test

Generic ProjectsTest Source # 
Instance details

Defined in Network.Google.Resource.FirebaseRules.Projects.Test

Associated Types

type Rep ProjectsTest :: Type -> Type #

GoogleRequest ProjectsTest Source # 
Instance details

Defined in Network.Google.Resource.FirebaseRules.Projects.Test

Associated Types

type Rs ProjectsTest :: Type #

type Scopes ProjectsTest :: [Symbol] #

type Rep ProjectsTest Source # 
Instance details

Defined in Network.Google.Resource.FirebaseRules.Projects.Test

type Rep ProjectsTest = D1 (MetaData "ProjectsTest" "Network.Google.Resource.FirebaseRules.Projects.Test" "gogol-firebase-rules-0.4.0-8f71BRcY6VI3IDZJSGi4Go" False) (C1 (MetaCons "ProjectsTest'" PrefixI True) ((S1 (MetaSel (Just "_ptXgafv") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Xgafv)) :*: (S1 (MetaSel (Just "_ptUploadProtocol") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_ptAccessToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 (MetaSel (Just "_ptUploadType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_ptPayload") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TestRulesetRequest)) :*: (S1 (MetaSel (Just "_ptName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_ptCallback") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))))
type Scopes ProjectsTest Source # 
Instance details

Defined in Network.Google.Resource.FirebaseRules.Projects.Test

type Scopes ProjectsTest = "https://www.googleapis.com/auth/cloud-platform" ': ("https://www.googleapis.com/auth/firebase" ': ("https://www.googleapis.com/auth/firebase.readonly" ': ([] :: [Symbol])))
type Rs ProjectsTest Source # 
Instance details

Defined in Network.Google.Resource.FirebaseRules.Projects.Test

Request Lenses

ptUploadProtocol :: Lens' ProjectsTest (Maybe Text) Source #

Upload protocol for media (e.g. "raw", "multipart").

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}`