Skip to content

Commit 6feb2c1

Browse files
authored
Declare listAppMetadata and setDisplayName methods in Project Management class (#12)
* Added AppMetadata type * Declare setDisplayName and listAppMetadata (unimplemented)
1 parent cbcc607 commit 6feb2c1

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*!
2+
* Copyright 2019 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
export class AppMetadata {
18+
public readonly appId: string;
19+
public readonly displayName: string;
20+
public readonly platform: AppPlatform;
21+
}
22+
23+
export enum AppPlatform {
24+
PLATFORM_UNKNOWN = 'PLATFORM_UNKNOWN',
25+
IOS = 'IOS',
26+
ANDROID = 'ANDROID',
27+
}

src/project-management/project-management.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import * as validator from '../utils/validator';
2222
import { AndroidApp, ShaCertificate } from './android-app';
2323
import { IosApp } from './ios-app';
2424
import { ProjectManagementRequestHandler, assertServerResponse } from './project-management-api-request';
25+
import { AppMetadata } from './AppMetadata';
2526

2627
/**
2728
* Internals of a Project Management instance.
@@ -147,6 +148,22 @@ export class ProjectManagement implements FirebaseServiceInterface {
147148
});
148149
}
149150

151+
/**
152+
* Lists summary of all apps in the project
153+
*/
154+
public listAppMetadata(): Promise<AppMetadata[]> {
155+
throw new FirebaseProjectManagementError(
156+
'service-unavailable', 'This service is not available');
157+
}
158+
159+
/**
160+
* Update display name of the project
161+
*/
162+
public setDisplayName(displayName: string): Promise<void> {
163+
throw new FirebaseProjectManagementError(
164+
'service-unavailable', 'This service is not available');
165+
}
166+
150167
/**
151168
* Lists up to 100 Firebase apps for a specified platform, associated with this Firebase project.
152169
*/

test/unit/project-management/project-management.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,5 +380,19 @@ describe('ProjectManagement', () => {
380380
return projectManagement.createIosApp(BUNDLE_ID)
381381
.should.eventually.deep.equal(createdIosApp);
382382
});
383+
384+
describe('listAppMetadata', () => {
385+
it('should throw service-unavailable error', () => {
386+
expect(() => projectManagement.listAppMetadata())
387+
.to.throw('This service is not available');
388+
});
389+
});
390+
391+
describe('setDisplayName', () => {
392+
it('should throw service-unavailable error', () => {
393+
expect(() => projectManagement.setDisplayName('new project name'))
394+
.to.throw('This service is not available');
395+
});
396+
});
383397
});
384398
});

0 commit comments

Comments
 (0)