Projects
class Projects extends Resource (View source)
The "projects" collection of methods.
Typical usage is:
$firebaseService = new Google\Service\FirebaseManagement(...);
$projects = $firebaseService->projects;
Methods
Adds Firebase resources to the specified existing [Google Cloud Platform
(GCP) Project
] (https://cloud.google.com/resource-
manager/reference/rest/v1/projects). Since a FirebaseProject is actually also
a GCP Project
, a FirebaseProject
has the same underlying GCP identifiers
(projectNumber
and projectId
). This allows for easy interop with Google
APIs. The result of this call is an Operation
.
Links the specified FirebaseProject with an existing Google Analytics account. Using this call, you can either:
- Specify an
analyticsAccountId
to provision a new Google Analytics property within the specified account and associate the new property with theFirebaseProject
. - Specify an existinganalyticsPropertyId
to associate the property with theFirebaseProject
. Note that when you callAddGoogleAnalytics
: 1. The first check determines if any existing data streams in the Google Analytics property correspond to any existing Firebase Apps in theFirebaseProject
(based on thepackageName
orbundleId
associated with the data stream). Then, as applicable, the data streams and apps are linked. Note that this auto-linking only applies toAndroidApps
andIosApps
. 2. If no corresponding data streams are found for the Firebase Apps, new data streams are provisioned in the Google Analytics property for each of the Firebase Apps. Note that a new data stream is always provisioned for a Web App even if it was previously associated with a data stream in the Analytics property. Learn more about the hierarchy and structure of Google Analytics accounts in the Analytics documentation. The result of this call is anOperation
. Poll theOperation
to track the provisioning process by calling GetOperation untildone
istrue
. Whendone
istrue
, theOperation
has either succeeded or failed. If theOperation
succeeded, itsresponse
is set to an AnalyticsDetails; if theOperation
failed, itserror
is set to a google.rpc.Status. To callAddGoogleAnalytics
, a project member must be an Owner for the existingFirebaseProject
and have theEdit
permission for the Google Analytics account. If theFirebaseProject
already has Google Analytics enabled, and you callAddGoogleAnalytics
using ananalyticsPropertyId
that's different from the currently associated property, then the call will fail. Analytics may have already been enabled in the Firebase console or by specifyingtimeZone
andregionCode
in the call toAddFirebase
.
Gets the specified FirebaseProject. (projects.get)
Gets the configuration artifact associated with the specified FirebaseProject, which can be used by servers to simplify initialization.
Gets the Google Analytics details currently associated with the specified
FirebaseProject. If the FirebaseProject
is not yet linked to Google
Analytics, then the response to GetAnalyticsDetails
is NOT_FOUND
.
Lists each FirebaseProject accessible to the caller. The elements are
returned in no particular order, but they will be a consistent view of the
Projects when additional requests are made with a pageToken
. This method is
eventually consistent with Project mutations, which means newly provisioned
Projects and recent modifications to existing Projects might not be reflected
in the set of Projects. The list will include only ACTIVE Projects. Use
GetFirebaseProject for consistent reads as well as for additional Project
details. (projects.listProjects)
Updates the attributes of the specified FirebaseProject. All query parameters are required. (projects.patch)
Unlinks the specified FirebaseProject from its Google Analytics account. This
call removes the association of the specified FirebaseProject
with its
current Google Analytics property. However, this call does not delete the
Google Analytics resources, such as the Google Analytics property or any data
streams. These resources may be re-associated later to the FirebaseProject
by calling AddGoogleAnalytics
and specifying the same analyticsPropertyId
. For Android Apps and iOS Apps,
this call re-links data streams with their corresponding apps. However, for
Web Apps, this call provisions a new data stream for each Web App. To call
RemoveAnalytics
, a project member must be an Owner for the
FirebaseProject
. (projects.removeAnalytics)
Lists all available Apps for the specified FirebaseProject. This is a convenience method. Typically, interaction with an App should be done using the platform-specific service, but some tool use-cases require a summary of all known Apps (such as for App selector interfaces). (projects.searchApps)
Details
Operation
addFirebase(string $project, AddFirebaseRequest $postBody, array $optParams = [])
Adds Firebase resources to the specified existing [Google Cloud Platform
(GCP) Project
] (https://cloud.google.com/resource-
manager/reference/rest/v1/projects). Since a FirebaseProject is actually also
a GCP Project
, a FirebaseProject
has the same underlying GCP identifiers
(projectNumber
and projectId
). This allows for easy interop with Google
APIs. The result of this call is an Operation
.
Poll the Operation
to track the provisioning process by calling
GetOperation until done
is true
. When done
is true
, the Operation
has either succeeded or
failed. If the Operation
succeeded, its
response
is set to a
FirebaseProject; if the Operation
failed, its
error
is set to a
google.rpc.Status. The Operation
is automatically deleted after completion,
so there is no need to call DeleteOperation. This method does not modify any
billing account information on the underlying GCP Project
. To call
AddFirebase
, a project member or service account must have the following
permissions (the IAM roles of Editor and Owner contain these permissions):
firebase.projects.update
, resourcemanager.projects.get
,
serviceusage.services.enable
, and serviceusage.services.get
.
(projects.addFirebase)
Operation
addGoogleAnalytics(string $parent, AddGoogleAnalyticsRequest $postBody, array $optParams = [])
Links the specified FirebaseProject with an existing Google Analytics account. Using this call, you can either:
- Specify an
analyticsAccountId
to provision a new Google Analytics property within the specified account and associate the new property with theFirebaseProject
. - Specify an existinganalyticsPropertyId
to associate the property with theFirebaseProject
. Note that when you callAddGoogleAnalytics
: 1. The first check determines if any existing data streams in the Google Analytics property correspond to any existing Firebase Apps in theFirebaseProject
(based on thepackageName
orbundleId
associated with the data stream). Then, as applicable, the data streams and apps are linked. Note that this auto-linking only applies toAndroidApps
andIosApps
. 2. If no corresponding data streams are found for the Firebase Apps, new data streams are provisioned in the Google Analytics property for each of the Firebase Apps. Note that a new data stream is always provisioned for a Web App even if it was previously associated with a data stream in the Analytics property. Learn more about the hierarchy and structure of Google Analytics accounts in the Analytics documentation. The result of this call is anOperation
. Poll theOperation
to track the provisioning process by calling GetOperation untildone
istrue
. Whendone
istrue
, theOperation
has either succeeded or failed. If theOperation
succeeded, itsresponse
is set to an AnalyticsDetails; if theOperation
failed, itserror
is set to a google.rpc.Status. To callAddGoogleAnalytics
, a project member must be an Owner for the existingFirebaseProject
and have theEdit
permission for the Google Analytics account. If theFirebaseProject
already has Google Analytics enabled, and you callAddGoogleAnalytics
using ananalyticsPropertyId
that's different from the currently associated property, then the call will fail. Analytics may have already been enabled in the Firebase console or by specifyingtimeZone
andregionCode
in the call toAddFirebase
.
(projects.addGoogleAnalytics)
FirebaseProject
get(string $name, array $optParams = [])
Gets the specified FirebaseProject. (projects.get)
AdminSdkConfig
getAdminSdkConfig(string $name, array $optParams = [])
Gets the configuration artifact associated with the specified FirebaseProject, which can be used by servers to simplify initialization.
Typically, this configuration is used with the Firebase Admin SDK initialize App command. (projects.getAdminSdkConfig)
AnalyticsDetails
getAnalyticsDetails(string $name, array $optParams = [])
Gets the Google Analytics details currently associated with the specified
FirebaseProject. If the FirebaseProject
is not yet linked to Google
Analytics, then the response to GetAnalyticsDetails
is NOT_FOUND
.
(projects.getAnalyticsDetails)
ListFirebaseProjectsResponse
listProjects(array $optParams = [])
Lists each FirebaseProject accessible to the caller. The elements are
returned in no particular order, but they will be a consistent view of the
Projects when additional requests are made with a pageToken
. This method is
eventually consistent with Project mutations, which means newly provisioned
Projects and recent modifications to existing Projects might not be reflected
in the set of Projects. The list will include only ACTIVE Projects. Use
GetFirebaseProject for consistent reads as well as for additional Project
details. (projects.listProjects)
FirebaseProject
patch(string $name, FirebaseProject $postBody, array $optParams = [])
Updates the attributes of the specified FirebaseProject. All query parameters are required. (projects.patch)
FirebaseEmpty
removeAnalytics(string $parent, RemoveAnalyticsRequest $postBody, array $optParams = [])
Unlinks the specified FirebaseProject from its Google Analytics account. This
call removes the association of the specified FirebaseProject
with its
current Google Analytics property. However, this call does not delete the
Google Analytics resources, such as the Google Analytics property or any data
streams. These resources may be re-associated later to the FirebaseProject
by calling AddGoogleAnalytics
and specifying the same analyticsPropertyId
. For Android Apps and iOS Apps,
this call re-links data streams with their corresponding apps. However, for
Web Apps, this call provisions a new data stream for each Web App. To call
RemoveAnalytics
, a project member must be an Owner for the
FirebaseProject
. (projects.removeAnalytics)
SearchFirebaseAppsResponse
searchApps(string $parent, array $optParams = [])
Lists all available Apps for the specified FirebaseProject. This is a convenience method. Typically, interaction with an App should be done using the platform-specific service, but some tool use-cases require a summary of all known Apps (such as for App selector interfaces). (projects.searchApps)