View Source GoogleApi.FirebaseRules.V1.Api.Projects (google_api_firebase_rules v0.17.0)
API calls for all endpoints tagged Projects
.
Summary
Functions
Create a Release
. Release names should reflect the developer's deployment practices. For example, the release name may include the environment name, application name, application version, or any other name meaningful to the developer. Once a Release
refers to a Ruleset
, the rules can be enforced by Firebase Rules-enabled services. More than one Release
may be 'live' concurrently. Consider the following three Release
names for projects/foo
and the Ruleset
to which they refer. Release Name -> Ruleset Name projects/foo/releases/prod -> projects/foo/rulesets/uuid123 projects/foo/releases/prod/beta -> projects/foo/rulesets/uuid123 * projects/foo/releases/prod/v23 -> projects/foo/rulesets/uuid456 The relationships reflect a Ruleset
rollout in progress. The prod
and prod/beta
releases refer to the same Ruleset
. However, prod/v23
refers to a new Ruleset
. The Ruleset
reference for a Release
may be updated using the UpdateRelease method.
Delete a Release
by resource name.
Get a Release
by name.
Get the Release
executable to use when enforcing rules.
List the Release
values for a project. This list may optionally be filtered by Release
name, Ruleset
name, TestSuite
name, or any combination thereof.
Update a Release
via PATCH. Only updates to ruleset_name
will be honored. Release
rename is not supported. To create a Release
use the CreateRelease method.
Create a Ruleset
from Source
. The Ruleset
is given a unique generated name which is returned to the caller. Source
containing syntactic or semantics errors will result in an error response indicating the first error encountered. For a detailed view of Source
issues, use TestRuleset.
Delete a Ruleset
by resource name. If the Ruleset
is referenced by a Release
the operation will fail.
Get a Ruleset
by name including the full Source
contents.
List Ruleset
metadata only and optionally filter the results by Ruleset
name. The full Source
contents of a Ruleset
may be retrieved with GetRuleset.
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/') } }
Functions
firebaserules_projects_releases_create(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_releases_create( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.Release.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
Create a Release
. Release names should reflect the developer's deployment practices. For example, the release name may include the environment name, application name, application version, or any other name meaningful to the developer. Once a Release
refers to a Ruleset
, the rules can be enforced by Firebase Rules-enabled services. More than one Release
may be 'live' concurrently. Consider the following three Release
names for projects/foo
and the Ruleset
to which they refer. Release Name -> Ruleset Name projects/foo/releases/prod -> projects/foo/rulesets/uuid123 projects/foo/releases/prod/beta -> projects/foo/rulesets/uuid123 * projects/foo/releases/prod/v23 -> projects/foo/rulesets/uuid456 The relationships reflect a Ruleset
rollout in progress. The prod
and prod/beta
releases refer to the same Ruleset
. However, prod/v23
refers to a new Ruleset
. The Ruleset
reference for a Release
may be updated using the UpdateRelease method.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name for the project which owns thisRelease
. Format:projects/{project_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart"). -
:body
(type:GoogleApi.FirebaseRules.V1.Model.Release.t
) -
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.Release{}}
on success -
{:error, info}
on failure
firebaserules_projects_releases_delete(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_releases_delete( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.Empty.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
Delete a Release
by resource name.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name for theRelease
to delete. Format:projects/{project_id}/releases/{release_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart").
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.Empty{}}
on success -
{:error, info}
on failure
firebaserules_projects_releases_get(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_releases_get( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.Release.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
Get a Release
by name.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name of theRelease
. Format:projects/{project_id}/releases/{release_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart").
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.Release{}}
on success -
{:error, info}
on failure
firebaserules_projects_releases_get_executable(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_releases_get_executable( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.GetReleaseExecutableResponse.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
Get the Release
executable to use when enforcing rules.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name of theRelease
. Format:projects/{project_id}/releases/{release_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart"). -
:executableVersion
(type:String.t
) - The requested runtime executable version. Defaults to FIREBASE_RULES_EXECUTABLE_V1.
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.GetReleaseExecutableResponse{}}
on success -
{:error, info}
on failure
firebaserules_projects_releases_list(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_releases_list( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.ListReleasesResponse.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
List the Release
values for a project. This list may optionally be filtered by Release
name, Ruleset
name, TestSuite
name, or any combination thereof.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name for the project. Format:projects/{project_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart"). -
:filter
(type:String.t
) -Release
filter. The list method supports filters with restrictions on theRelease.name
, andRelease.ruleset_name
. Example 1: A filter of 'name=prod' might returnRelease
s with names within 'projects/foo' prefixed with 'prod': Name -> Ruleset Name: projects/foo/releases/prod -> projects/foo/rulesets/uuid1234 projects/foo/releases/prod/v1 -> projects/foo/rulesets/uuid1234 projects/foo/releases/prod/v2 -> projects/foo/rulesets/uuid8888 Example 2: A filter ofname=prod* ruleset_name=uuid1234
would return onlyRelease
instances for 'projects/foo' with names prefixed with 'prod' referring to the sameRuleset
name of 'uuid1234': Name -> Ruleset Name: projects/foo/releases/prod -> projects/foo/rulesets/1234 projects/foo/releases/prod/v1 -> projects/foo/rulesets/1234 In the examples, the filter parameters refer to the search filters are relative to the project. Fully qualified prefixed may also be used. -
:pageSize
(type:integer()
) - Page size to load. Maximum of 100. Defaults to 10. Note:page_size
is just a hint and the service may choose to load fewer thanpage_size
results due to the size of the output. To traverse all of the releases, the caller should iterate until thepage_token
on the response is empty. -
:pageToken
(type:String.t
) - Next page token for the next batch ofRelease
instances.
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.ListReleasesResponse{}}
on success -
{:error, info}
on failure
firebaserules_projects_releases_patch(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_releases_patch( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.Release.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
Update a Release
via PATCH. Only updates to ruleset_name
will be honored. Release
rename is not supported. To create a Release
use the CreateRelease method.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name for the project which owns thisRelease
. Format:projects/{project_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart"). -
:body
(type:GoogleApi.FirebaseRules.V1.Model.UpdateReleaseRequest.t
) -
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.Release{}}
on success -
{:error, info}
on failure
firebaserules_projects_rulesets_create(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_rulesets_create( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.Ruleset.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
Create a Ruleset
from Source
. The Ruleset
is given a unique generated name which is returned to the caller. Source
containing syntactic or semantics errors will result in an error response indicating the first error encountered. For a detailed view of Source
issues, use TestRuleset.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name for Project which owns thisRuleset
. Format:projects/{project_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart"). -
:body
(type:GoogleApi.FirebaseRules.V1.Model.Ruleset.t
) -
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.Ruleset{}}
on success -
{:error, info}
on failure
firebaserules_projects_rulesets_delete(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_rulesets_delete( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.Empty.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
Delete a Ruleset
by resource name. If the Ruleset
is referenced by a Release
the operation will fail.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name for the ruleset to delete. Format:projects/{project_id}/rulesets/{ruleset_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart").
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.Empty{}}
on success -
{:error, info}
on failure
firebaserules_projects_rulesets_get(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_rulesets_get( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.Ruleset.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
Get a Ruleset
by name including the full Source
contents.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name for the ruleset to get. Format:projects/{project_id}/rulesets/{ruleset_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart").
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.Ruleset{}}
on success -
{:error, info}
on failure
firebaserules_projects_rulesets_list(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_rulesets_list( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.ListRulesetsResponse.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
List Ruleset
metadata only and optionally filter the results by Ruleset
name. The full Source
contents of a Ruleset
may be retrieved with GetRuleset.
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Resource name for the project. Format:projects/{project_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart"). -
:filter
(type:String.t
) -Ruleset
filter. The list method supports filters with restrictions onRuleset.name
. Filters onRuleset.create_time
should use thedate
function which parses strings that conform to the RFC 3339 date/time specifications. Example:create_time > date("2017-01-01T00:00:00Z") AND name=UUID-*
-
:pageSize
(type:integer()
) - Page size to load. Maximum of 100. Defaults to 10. Note:page_size
is just a hint and the service may choose to load less thanpage_size
due to the size of the output. To traverse all of the releases, caller should iterate until thepage_token
is empty. -
:pageToken
(type:String.t
) - Next page token for loading the next batch ofRuleset
instances.
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.ListRulesetsResponse{}}
on success -
{:error, info}
on failure
firebaserules_projects_test(connection, name, optional_params \\ [], opts \\ [])
View Source@spec firebaserules_projects_test( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.FirebaseRules.V1.Model.TestRulesetResponse.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
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/') } }
Parameters
-
connection
(type:GoogleApi.FirebaseRules.V1.Connection.t
) - Connection to server -
name
(type:String.t
) - Required. Tests may either providesource
or aRuleset
resource name. For tests againstsource
, the resource name must refer to the project: Format:projects/{project_id}
For tests against aRuleset
, this must be theRuleset
resource name: Format:projects/{project_id}/rulesets/{ruleset_id}
-
optional_params
(type:keyword()
) - Optional parameters-
:"$.xgafv"
(type:String.t
) - V1 error format. -
:access_token
(type:String.t
) - OAuth access token. -
:alt
(type:String.t
) - Data format for response. -
:callback
(type:String.t
) - JSONP -
:fields
(type:String.t
) - Selector specifying which fields to include in a partial response. -
:key
(type:String.t
) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. -
:oauth_token
(type:String.t
) - OAuth 2.0 token for the current user. -
:prettyPrint
(type:boolean()
) - Returns response with indentations and line breaks. -
:quotaUser
(type:String.t
) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. -
:uploadType
(type:String.t
) - Legacy upload protocol for media (e.g. "media", "multipart"). -
:upload_protocol
(type:String.t
) - Upload protocol for media (e.g. "raw", "multipart"). -
:body
(type:GoogleApi.FirebaseRules.V1.Model.TestRulesetRequest.t
) -
-
-
opts
(type:keyword()
) - Call options
Returns
-
{:ok, %GoogleApi.FirebaseRules.V1.Model.TestRulesetResponse{}}
on success -
{:error, info}
on failure