MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / handler

Function handler

src/commands/rules/create.ts:46–56  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

44 .epilog(buildEpilog({ command, apiDocs: ['createRule'] }))
45
46const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
47 const command = await apiCommand(argv)
48
49 const locationId = await chooseLocation(command, argv.location)
50
51 await inputAndOutputItem<RuleRequest, Rule>(
52 command,
53 { tableFieldDefinitions },
54 (_, rule) => command.client.rules.create(rule, locationId),
55 )
56}
57
58const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
59export default cmd

Callers

nothing calls this directly

Calls 1

apiCommandFunction · 0.85

Tested by

no test coverage detected