@@ -115,32 +115,44 @@ export class ProjectManagementRequestHandler {
115
115
this . httpClient = new AuthorizedHttpClient ( app ) ;
116
116
}
117
117
118
- public listAndroidApps ( projectId : string ) : Promise < object > {
118
+ /**
119
+ * @param {string } parentResourceName Fully-qualified resource name of the project whose Android
120
+ * apps you want to list.
121
+ */
122
+ public listAndroidApps ( parentResourceName : string ) : Promise < object > {
119
123
return this . invokeRequestHandler (
120
124
'GET' ,
121
- `projects/ ${ projectId } /androidApps?page_size=${ LIST_APPS_MAX_PAGE_SIZE } ` ,
125
+ `${ parentResourceName } /androidApps?page_size=${ LIST_APPS_MAX_PAGE_SIZE } ` ,
122
126
/* requestData */ null ,
123
127
'v1beta1' ) ;
124
128
}
125
129
126
- public listIosApps ( projectId : string ) : Promise < object > {
130
+ /**
131
+ * @param {string } parentResourceName Fully-qualified resource name of the project whose iOS apps
132
+ * you want to list.
133
+ */
134
+ public listIosApps ( parentResourceName : string ) : Promise < object > {
127
135
return this . invokeRequestHandler (
128
136
'GET' ,
129
- `projects/ ${ projectId } /iosApps?page_size=${ LIST_APPS_MAX_PAGE_SIZE } ` ,
137
+ `${ parentResourceName } /iosApps?page_size=${ LIST_APPS_MAX_PAGE_SIZE } ` ,
130
138
/* requestData */ null ,
131
139
'v1beta1' ) ;
132
140
}
133
141
142
+ /**
143
+ * @param {string } parentResourceName Fully-qualified resource name of the project that you want
144
+ * to create the Android app within.
145
+ */
134
146
public createAndroidApp (
135
- projectId : string , packageName : string , displayName ?: string ) : Promise < object > {
147
+ parentResourceName : string , packageName : string , displayName ?: string ) : Promise < object > {
136
148
const requestData : any = {
137
149
packageName,
138
150
} ;
139
151
if ( validator . isNonEmptyString ( displayName ) ) {
140
152
requestData . displayName = displayName ;
141
153
}
142
154
return this
143
- . invokeRequestHandler ( 'POST' , `projects/ ${ projectId } /androidApps` , requestData , 'v1beta1' )
155
+ . invokeRequestHandler ( 'POST' , `${ parentResourceName } /androidApps` , requestData , 'v1beta1' )
144
156
. then ( ( responseData : any ) => {
145
157
assertServerResponse (
146
158
validator . isNonNullObject ( responseData ) ,
@@ -154,16 +166,20 @@ export class ProjectManagementRequestHandler {
154
166
} ) ;
155
167
}
156
168
169
+ /**
170
+ * @param {string } parentResourceName Fully-qualified resource name of the project that you want
171
+ * to create the iOS app within.
172
+ */
157
173
public createIosApp (
158
- projectId : string , bundleId : string , displayName ?: string ) : Promise < object > {
174
+ parentResourceName : string , bundleId : string , displayName ?: string ) : Promise < object > {
159
175
const requestData : any = {
160
176
bundleId,
161
177
} ;
162
178
if ( validator . isNonEmptyString ( displayName ) ) {
163
179
requestData . displayName = displayName ;
164
180
}
165
181
return this
166
- . invokeRequestHandler ( 'POST' , `projects/ ${ projectId } /iosApps` , requestData , 'v1beta1' )
182
+ . invokeRequestHandler ( 'POST' , `${ parentResourceName } /iosApps` , requestData , 'v1beta1' )
167
183
. then ( ( responseData : any ) => {
168
184
assertServerResponse (
169
185
validator . isNonNullObject ( responseData ) ,
@@ -177,69 +193,69 @@ export class ProjectManagementRequestHandler {
177
193
} ) ;
178
194
}
179
195
180
- public getAndroidMetadata ( appId : string ) : Promise < object > {
181
- return this . invokeRequestHandler (
182
- 'GET' , `projects/-/androidApps/${ appId } ` , /* requestData */ null , 'v1beta1' ) ;
183
- }
184
-
185
- public getIosMetadata ( appId : string ) : Promise < object > {
186
- return this . invokeRequestHandler (
187
- 'GET' , `projects/-/iosApps/${ appId } ` , /* requestData */ null , 'v1beta1' ) ;
188
- }
189
-
190
- public setAndroidDisplayName ( appId : string , newDisplayName : string ) : Promise < void > {
191
- const requestData = {
192
- displayName : newDisplayName ,
193
- } ;
194
- return this
195
- . invokeRequestHandler (
196
- 'PATCH' ,
197
- `projects/-/androidApps/${ appId } ?update_mask=display_name` ,
198
- requestData ,
199
- 'v1beta1' )
200
- . then ( ( ) => null ) ;
201
- }
202
-
203
- public setIosDisplayName ( appId : string , newDisplayName : string ) : Promise < void > {
196
+ /**
197
+ * @param {string } resourceName Fully-qualified resource name of the entity whose display name you
198
+ * want to set.
199
+ */
200
+ public setDisplayName ( resourceName : string , newDisplayName : string ) : Promise < void > {
204
201
const requestData = {
205
202
displayName : newDisplayName ,
206
203
} ;
207
204
return this
208
205
. invokeRequestHandler (
209
- 'PATCH' , `projects/-/iosApps/ ${ appId } ?update_mask=display_name` , requestData , 'v1beta1' )
206
+ 'PATCH' , `${ resourceName } ?update_mask=display_name` , requestData , 'v1beta1' )
210
207
. then ( ( ) => null ) ;
211
208
}
212
209
213
- public getAndroidShaCertificates ( appId : string ) : Promise < object > {
210
+ /**
211
+ * @param {string } parentResourceName Fully-qualified resource name of the Android app whose SHA
212
+ * certificates you want to get.
213
+ */
214
+ public getAndroidShaCertificates ( parentResourceName : string ) : Promise < object > {
214
215
return this . invokeRequestHandler (
215
- 'GET' , `projects/-/androidApps/ ${ appId } /sha` , /* requestData */ null , 'v1beta1' ) ;
216
+ 'GET' , `${ parentResourceName } /sha` , /* requestData */ null , 'v1beta1' ) ;
216
217
}
217
218
218
- public addAndroidShaCertificate ( appId : string , certificate : ShaCertificate ) : Promise < void > {
219
+ /**
220
+ * @param {string } parentResourceName Fully-qualified resource name of the Android app that you
221
+ * want to add the given SHA certificate to.
222
+ */
223
+ public addAndroidShaCertificate (
224
+ parentResourceName : string , certificate : ShaCertificate ) : Promise < void > {
219
225
const requestData = {
220
226
shaHash : certificate . shaHash ,
221
227
certType : CERT_TYPE_API_MAP [ certificate . certType ] ,
222
228
} ;
223
229
return this
224
- . invokeRequestHandler ( 'POST' , `projects/-/androidApps/ ${ appId } /sha` , requestData , 'v1beta1' )
230
+ . invokeRequestHandler ( 'POST' , `${ parentResourceName } /sha` , requestData , 'v1beta1' )
225
231
. then ( ( ) => null ) ;
226
232
}
227
233
228
- public deleteAndroidShaCertificate ( certificateToDelete : ShaCertificate ) : Promise < void > {
229
- return this
230
- . invokeRequestHandler (
231
- 'DELETE' , certificateToDelete . resourceName , /* requestData */ null , 'v1beta1' )
232
- . then ( ( ) => null ) ;
234
+ /**
235
+ * @param {string } parentResourceName Fully-qualified resource name of the app whose config you
236
+ * want to get.
237
+ */
238
+ public getConfig ( parentResourceName : string ) : Promise < object > {
239
+ return this . invokeRequestHandler (
240
+ 'GET' , `${ parentResourceName } /config` , /* requestData */ null , 'v1beta1' ) ;
233
241
}
234
242
235
- public getAndroidConfig ( appId : string ) : Promise < object > {
236
- return this . invokeRequestHandler (
237
- 'GET' , `projects/-/androidApps/${ appId } /config` , /* requestData */ null , 'v1beta1' ) ;
243
+ /**
244
+ * @param {string } parentResourceName Fully-qualified resource name of the entity that you want to
245
+ * get.
246
+ */
247
+ public getResource ( parentResourceName : string ) : Promise < object > {
248
+ return this . invokeRequestHandler ( 'GET' , parentResourceName , /* requestData */ null , 'v1beta1' ) ;
238
249
}
239
250
240
- public getIosConfig ( appId : string ) : Promise < object > {
241
- return this . invokeRequestHandler (
242
- 'GET' , `projects/-/iosApps/${ appId } /config` , /* requestData */ null , 'v1beta1' ) ;
251
+ /**
252
+ * @param {string } resourceName Fully-qualified resource name of the entity that you want to
253
+ * delete.
254
+ */
255
+ public deleteResource ( resourceName : string ) : Promise < void > {
256
+ return this
257
+ . invokeRequestHandler ( 'DELETE' , resourceName , /* requestData */ null , 'v1beta1' )
258
+ . then ( ( ) => null ) ;
243
259
}
244
260
245
261
private pollRemoteOperationWithExponentialBackoff (
0 commit comments