Skip to main content

resource_policies

Creates, updates, deletes, gets or lists a resource_policies resource.

Overview

Nameresource_policies
TypeResource
Idfirebase.appcheck.resource_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Identifier. The relative name of the resource policy object, in the format: projects/{project_number}/services/{service_id}/resourcePolicies/{resource_policy_id} Note that the service_id element must be a supported service ID. Currently, the following service IDs are supported: * oauth2.googleapis.com (Google Identity for iOS) resource_policy_id is a system-generated UID.
enforcementModestringRequired. The App Check enforcement mode for this resource. This will override the EnforcementMode setting on the service.
etagstringThis checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. This etag is strongly validated as defined by RFC 7232.
targetResourcestringRequired. Service specific name of the resource object to which this policy applies, in the format: * iOS OAuth clients (Google Identity for iOS): //oauth2.googleapis.com/projects/{project_number}/oauthClients/{oauth_client_id} Note that the resource must belong to the service specified in the name and be from the same project as this policy, but the resource is allowed to be missing at the time of creation of this policy; in that case, we make a best-effort attempt at respecting this policy, but it may not have any effect until the resource is fully created.
updateTimestring (google-datetime)Output only. Timestamp when this resource policy configuration object was most recently updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, servicesId, resourcePoliciesIdGets the requested ResourcePolicy configuration.
listselectprojectsId, servicesIdpageSize, pageToken, filterLists all ResourcePolicy configurations for the specified project and service.
createinsertprojectsId, servicesIdCreates the specified ResourcePolicy configuration.
patchupdateprojectsId, servicesId, resourcePoliciesIdupdateMaskUpdates the specified ResourcePolicy configuration.
batch_updateupdateprojectsId, servicesIdAtomically updates the specified ResourcePolicy configurations.
deletedeleteprojectsId, servicesId, resourcePoliciesIdetagDeletes the specified ResourcePolicy configuration.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
projectsIdstring
resourcePoliciesIdstring
servicesIdstring
etagstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the requested ResourcePolicy configuration.

SELECT
name,
enforcementMode,
etag,
targetResource,
updateTime
FROM firebase.appcheck.resource_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND servicesId = '{{ servicesId }}' -- required
AND resourcePoliciesId = '{{ resourcePoliciesId }}' -- required;

INSERT examples

Creates the specified ResourcePolicy configuration.

INSERT INTO firebase.appcheck.resource_policies (
data__name,
data__targetResource,
data__enforcementMode,
data__etag,
projectsId,
servicesId
)
SELECT
'{{ name }}',
'{{ targetResource }}',
'{{ enforcementMode }}',
'{{ etag }}',
'{{ projectsId }}',
'{{ servicesId }}'
RETURNING
name,
enforcementMode,
etag,
targetResource,
updateTime
;

UPDATE examples

Updates the specified ResourcePolicy configuration.

UPDATE firebase.appcheck.resource_policies
SET
data__name = '{{ name }}',
data__targetResource = '{{ targetResource }}',
data__enforcementMode = '{{ enforcementMode }}',
data__etag = '{{ etag }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND servicesId = '{{ servicesId }}' --required
AND resourcePoliciesId = '{{ resourcePoliciesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
enforcementMode,
etag,
targetResource,
updateTime;

DELETE examples

Deletes the specified ResourcePolicy configuration.

DELETE FROM firebase.appcheck.resource_policies
WHERE projectsId = '{{ projectsId }}' --required
AND servicesId = '{{ servicesId }}' --required
AND resourcePoliciesId = '{{ resourcePoliciesId }}' --required
AND etag = '{{ etag }}';