@@ -157,7 +157,9 @@ export interface DeviceResult {
157157
158158export interface InstalledSchemaApp {
159159 /**
160- * Possible values - __requiresLogin__ or __loggedIn__. These two values determine what fields are returned in this response. If value is "requiresLogin", only "oAuthLink" is returned in the response. If value is "loggedIn", only isaId, partnerName, appName, devices and icons are returned.
160+ * Possible values - __requiresLogin__ or __loggedIn__. These two values determine what fields are returned in
161+ * this response. If value is "requiresLogin", only "oAuthLink" is returned in the response. If value is
162+ * "loggedIn", only isaId, partnerName, appName, devices and icons are returned.
161163 */
162164 pageType ?: string
163165
@@ -235,7 +237,7 @@ export interface SchemaPage {
235237export interface UnauthorizedSchemaPage extends SchemaPage {
236238 /**
237239 * An href to the OAuth page for this connector that allows authentication and connection to the SmartThings
238- * patform .
240+ * platform .
239241 */
240242 oAuthLink ?: string
241243}
@@ -269,6 +271,7 @@ export class SchemaEndpoint extends Endpoint {
269271
270272 /**
271273 * Returns a specific ST Schema connector
274+ *
272275 * @param id the "endpointApp" UUID of the connector, e.g. "viper_799ff3a0-8249-11e9-9bf1-b5c7d651c2c3"
273276 */
274277 public get ( id : string ) : Promise < SchemaApp > {
@@ -277,25 +280,35 @@ export class SchemaEndpoint extends Endpoint {
277280
278281 /**
279282 * Create an ST Schema connector
283+ *
280284 * @param data definition of the connector
285+ * @param organizationId The organization to associate the connector with. You must be a member
286+ * of the organization. Overrides any organization header included when creating the
287+ * `SmartThingsClient`.
281288 */
282- public create ( data : SchemaAppRequest ) : Promise < SchemaCreateResponse > {
283- return this . client . post < SchemaCreateResponse > ( 'apps' , data )
289+ public create ( data : SchemaAppRequest , organizationId ?: string ) : Promise < SchemaCreateResponse > {
290+ const options = organizationId ? { headerOverrides : { 'X-ST-Organization' : organizationId } } : undefined
291+ return this . client . post < SchemaCreateResponse > ( 'apps' , data , undefined , options )
284292 }
285293
286294 /**
287295 * Update an ST Schema connector
296+ *
288297 * @param id the "endpointApp" UUID of the connector, e.g. "viper_799ff3a0-8249-11e9-9bf1-b5c7d651c2c3"
289298 * @param data new definition of the connector
299+ * @param organizationId The organization to associate the connector with. You must be a member
300+ * of the organization. The organization cannot be changed if the connector's `certificationStatus` is `wwst`.
290301 */
291- public async update ( id : string , data : SchemaAppRequest ) : Promise < Status > {
292- await this . client . put < SchemaApp > ( `apps/${ id } ` , data )
302+ public async update ( id : string , data : SchemaAppRequest , organizationId ?: string ) : Promise < Status > {
303+ const options = organizationId ? { headerOverrides : { 'X-ST-Organization' : organizationId } } : undefined
304+ await this . client . put < SchemaApp > ( `apps/${ id } ` , data , undefined , options )
293305 return SuccessStatusValue
294306 }
295307
296308 /**
297309 * Re-generate the OAuth clientId and clientSecret for an ST Schema connector. The old clientId and clientSecret
298310 * will no longer be valid after this operation.
311+ *
299312 * @param id the "endpointApp" UUID of the connector, e.g. "viper_799ff3a0-8249-11e9-9bf1-b5c7d651c2c3"
300313 */
301314 public regenerateOauth ( id : string ) : Promise < SchemaCreateResponse > {
@@ -304,6 +317,7 @@ export class SchemaEndpoint extends Endpoint {
304317
305318 /**
306319 * Delete an ST Schema connector
320+ *
307321 * @param id the "endpointApp" UUID of the connector, e.g. "viper_799ff3a0-8249-11e9-9bf1-b5c7d651c2c3"
308322 */
309323 public async delete ( id : string ) : Promise < Status > {
@@ -313,6 +327,7 @@ export class SchemaEndpoint extends Endpoint {
313327
314328 /**
315329 * Get the page definition of an ST Schema installed instance in the specified location.
330+ *
316331 * @param id the "endpointApp" UUID of the connector, e.g. "viper_799ff3a0-8249-11e9-9bf1-b5c7d651c2c3"
317332 * @param locationId UUID of the location in which the connector is or is to be installed.
318333 */
@@ -322,6 +337,7 @@ export class SchemaEndpoint extends Endpoint {
322337
323338 /**
324339 * Returns a list of the installed ST Schema connector instances in the specified location
340+ *
325341 * @param locationId UUID of the location
326342 */
327343 public async installedApps ( locationId ?: string ) : Promise < InstalledSchemaApp [ ] > {
@@ -332,6 +348,7 @@ export class SchemaEndpoint extends Endpoint {
332348 /**
333349 * Returns a specific installed instance of an ST Schema connector. The returned object includes a list of the
334350 * devices created by the instance.
351+ *
335352 * @param id UUID of the installed app instance
336353 */
337354 public getInstalledApp ( id : string ) : Promise < InstalledSchemaApp > {
@@ -341,7 +358,6 @@ export class SchemaEndpoint extends Endpoint {
341358 /**
342359 * Deletes a specific installed instance of an ST Schema connector. This operation will also delete all
343360 * devices created by this instance
344- * @param id
345361 */
346362 public async deleteInstalledApp ( id : string ) : Promise < Status > {
347363 await this . client . delete ( `installedapps/${ id } ` )
0 commit comments