(argv: ArgumentsCamelCase<CommandArgs>)
| 50 | .epilog(buildEpilog({ command, apiDocs: 'updateDeviceProfile' })) |
| 51 | |
| 52 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 53 | const command = await apiOrganizationCommand(argv) |
| 54 | |
| 55 | const id = await chooseDeviceProfile(command, argv.idOrIndex) |
| 56 | const executeUpdate: ActionFunction<void, DeviceDefinitionRequest, DeviceProfile> = async (_, data) => { |
| 57 | if (data.view) { |
| 58 | return fatalError('Input contains "view" property. Use deviceprofiles:view:update instead.') |
| 59 | } |
| 60 | |
| 61 | return command.client.deviceProfiles.update(id, cleanupForUpdate(data)) |
| 62 | } |
| 63 | await inputAndOutputItem( |
| 64 | command, |
| 65 | { buildTableOutput: data => buildTableOutput(command.tableGenerator, data, { includePreferences: true }) }, |
| 66 | executeUpdate, |
| 67 | ) |
| 68 | } |
| 69 | |
| 70 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 71 | export default cmd |
nothing calls this directly
no test coverage detected