Skip to content

Adding comments for admin.projectManagement. #547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
291 changes: 291 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4786,56 +4786,347 @@ declare namespace admin.instanceId {
}

declare namespace admin.projectManagement {

/**
* A SHA-1 or SHA-256 certificate.
*
* Do not call this constructor directly. Instead, use
* [`projectManagement.shaCertificate()`](admin.projectManagement.ProjectManagement#shaCertificate).
*/
interface ShaCertificate {

/**
* The SHA certificate type.
*
* @example
* ```javascript
* var certType = shaCertificate.certType;
* ```
*/
certType: ('sha1' | 'sha256');

/**
* The SHA-1 or SHA-256 hash for this certificate.
*
* @example
* ```javascript
* var shaHash = shaCertificate.shaHash;
* ```
*/
shaHash: string;

/**
* The fully-qualified resource name that identifies this sha-key.
*
* This is useful when manually constructing requests for Firebase's public API.
*
* @example
* ```javascript
* var resourceName = shaCertificate.resourceName;
* ```
*/
resourceName?: string;
}

/**
* Metadata about a Firebase Android app.
*/
interface AndroidAppMetadata {

/**
* The fully-qualified resource name that identifies this app.
*
* This is useful when manually constructing requests for Firebase's public API.
*
* @example
* ```javascript
* var resourceName = androidAppMetadata.resourceName;
* ```
*/
resourceName: string;

/**
* The globally unique, Firebase-assigned identifier of the app.
*
* @example
* ```javascript
* var appId = androidAppMetadata.appId;
* ```
*/
appId: string;

/**
* The optional user-assigned display name of the app.
*
* @example
* ```javascript
* var displayName = androidAppMetadata.displayName;
* ```
*/
displayName: string | null;

/**
* The globally unique, user-assigned ID of the parent project for the app.
*
* @example
* ```javascript
* var projectId = androidAppMetadata.projectId;
* ```
*/
projectId: string;

/**
* The canonical package name of the Android App, as would appear in the Google
* Play Developer Console.
*
* @example
* ```javascript
* var packageName = androidAppMetadata.packageName;
* ```
*/
packageName: string;
}

/**
* A reference to a Firebase Android app.
*
* Do not call this constructor directly. Instead, use
* [`projectManagement.androidApp()`](admin.projectManagement.ProjectManagement#androidApp).
*/
interface AndroidApp {
appId: string;

/**
* Retrieves metadata about this Android app.
*
* @return A promise that resolves to the retrieved metadata about this Android app.
*/
getMetadata(): Promise<admin.projectManagement.AndroidAppMetadata>;

/**
* Sets the optional user-assigned display name of the app.
*
* @param newDisplayName The new display name to set.
*
* @return A promise that resolves when the display name has been set.
*/
setDisplayName(newDisplayName: string): Promise<void>;

/**
* Gets the list of SHA certificates associated with this Android app in Firebase.
*
* @return The list of SHA-1 and SHA-256 certificates associated with this Android app in
* Firebase.
*/
getShaCertificates(): Promise<admin.projectManagement.ShaCertificate[]>;

/**
* Adds the given SHA certificate to this Android app.
*
* @param certificateToAdd The SHA certificate to add.
*
* @return A promise that resolves when the given certificate
* has been added to the Android app.
*/
addShaCertificate(certificateToAdd: ShaCertificate): Promise<void>;

/**
* Deletes the specified SHA certificate from this Android app.
*
* @param certificateToDelete The SHA certificate to delete.
*
* @return A promise that resolves when the specified
* certificate has been removed from the Android app.
*/
deleteShaCertificate(certificateToRemove: ShaCertificate): Promise<void>;

/**
* Gets the configuration artifact associated with this app.
*
* @return A promise that resolves to the Android app's
* Firebase config file, in UTF-8 string format. This string is typically
* intended to be written to a JSON file that gets shipped with your Android
* app.
*/
getConfig(): Promise<string>;
}

/**
* Metadata about a Firebase iOS app.
*/
interface IosAppMetadata {

/**
* The fully-qualified resource name that identifies this app.
*
* This is useful when manually constructing requests for Firebase's public API.
*
* @example
* ```javascript
* var resourceName = iOSAppMetadata.resourceName;
* ```
*/
resourceName: string;

/**
* The globally unique, Firebase-assigned identifier of the app.
*
* @example
* ```javascript
* var appId = androidAppMetadata.appId;
* ``
*/
appId: string;

/**
* The optional user-assigned display name of the app.
*
* @example
* ```javascript
* var displayName = iOSAppMetadata.displayName;
* ```
*/
displayName: string;

/**
* The globally unique, user-assigned ID of the parent project for the app.
*
* @example
* ```javascript
* var projectId = iOSAppMetadata.projectId;
* ```
*/
projectId: string;

/**
* The canonical bundle ID of the iOS App as it would appear in the iOS App
* Store.
*
* @example
* ```javascript
* var bundleId = iosAppMetadata.bundleId;
*```
*/
bundleId: string;
}

/**
* A reference to a Firebase iOS app.
*
* Do not call this constructor directly. Instead, use
* [`projectManagement.iosApp()`](admin.projectManagement.ProjectManagement#iosApp).
*/
interface IosApp {
appId: string;

/**
* Retrieves metadata about this iOS app.
*
* @return {!Promise<admin.projectManagement.IosAppMetadata>} A promise that
* resolves to the retrieved metadata about this iOS app.
*/
getMetadata(): Promise<admin.projectManagement.IosAppMetadata>;

/**
* Sets the optional user-assigned display name of the app.
*
* @param newDisplayName The new display name to set.
*
* @return A promise that resolves when the display name has
* been set.
*/
setDisplayName(newDisplayName: string): Promise<void>;

/**
* Gets the configuration artifact associated with this app.
*
* @return A promise that resolves to the iOS app's Firebase
* config file, in UTF-8 string format. This string is typically intended to
* be written to a plist file that gets shipped with your iOS app.
*/
getConfig(): Promise<string>;
}

/**
* The Firebase ProjectManagement service interface.
*
* Do not call this constructor directly. Instead, use
* [`admin.projectManagement()`](admin.projectManagement#projectManagement).
*/
interface ProjectManagement {
app: admin.app.App;

/**
* Lists up to 100 Firebase Android apps associated with this Firebase project.
*
* @return The list of Android apps.
*/
listAndroidApps(): Promise<admin.projectManagement.AndroidApp[]>;

/**
* Lists up to 100 Firebase iOS apps associated with this Firebase project.
*
* @return The list of iOS apps.
*/
listIosApps(): Promise<admin.projectManagement.IosApp[]>;

/**
* Creates an `AndroidApp` object, referencing the specified Android app within
* this Firebase project.
*
* This method does not perform an RPC.
*
* @param appId The `appId` of the Android app to reference.
*
* @return An `AndroidApp` object that references the specified Firebase Android app.
*/
androidApp(appId: string): admin.projectManagement.AndroidApp;

/**
* Creates an `iOSApp` object, referencing the specified iOS app within
* this Firebase project.
*
* This method does not perform an RPC.
*
* @param appId The `appId` of the iOS app to reference.
*
* @return An `iOSApp` object that references the specified Firebase iOS app.
*/
iosApp(appId: string): admin.projectManagement.IosApp;

/**
* Creates a `ShaCertificate` object.
*
* This method does not perform an RPC.
*
* @param shaHash The SHA-1 or SHA-256 hash for this certificate.
*
* @return A `ShaCertificate` object contains the specified SHA hash.
*/
shaCertificate(shaHash: string): admin.projectManagement.ShaCertificate;

/**
* Creates a new Firebase Android app associated with this Firebase project.
*
* @param packageName The canonical package name of the Android App,
* as would appear in the Google Play Developer Console.
* @param displayName An optional user-assigned display name for this
* new app.
*
* @return A promise that resolves to the newly created Android app.
*/
createAndroidApp(
packageName: string, displayName?: string): Promise<admin.projectManagement.AndroidApp>;

/**
* Creates a new Firebase iOS app associated with this Firebase project.
*
* @param bundleId The iOS app bundle ID to use for this new app.
* @param displayName An optional user-assigned display name for this
* new app.
*
* @return A promise that resolves to the newly created iOS app.
*/
createIosApp(bundleId: string, displayName?: string): Promise<admin.projectManagement.IosApp>;
}
}
Expand Down