[TW-4826] feat(scheduler): add extended flags, file input, and validation to configurations#47
Merged
qasim-nylas merged 1 commit intomainfrom Apr 11, 2026
Conversation
…tion to configurations Add 16 new flags to scheduler configurations create/update commands covering availability, event booking, scheduler settings, and JSON file input with flag-override support. Extract helpers for validation and request building, and move validation before auth for fail-fast error handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhances
nylas scheduler configurations createandupdatecommands with full Nylas Scheduler API coverage, JSON file input support, and fail-fast validation.--fileJSON input with flag-override supportconfigurations_helpers.gofor flag registration, enum validation, request building, and display formattingDetails
New Flags
--interval,--round-to,--availability-method,--buffer-before,--buffer-after--timezone,--booking-type,--conferencing-provider,--disable-emails,--reminder-minutes--min-booking-notice,--min-cancellation-notice,--confirmation-method,--available-days-in-future,--cancellation-policy--file(JSON config file; flags override file values)File Input Support
Users can now create/update configurations from a JSON file matching the API request structure. When both
--fileand flags are provided, flags take precedence over file values. This enables workflows like:Refactoring
configurations_helpers.go(new) — ExtractedconfigFlagsstruct,registerConfigFlags(),validateConfigFlags(),buildCreateRequest(),buildUpdateRequest(), andformatConfigDetails()from inline code inconfigurations.govalidateConfigFlags()checks enum values andvalidateCreateRequest()/validateUpdateRequest()check required fields beforeWithClient()is called, so errors like missing--nameor invalid--booking-typesurface without requiring authMarkFlagRequired— Replaced with custom validation to support the--fileinput path where fields come from the file rather than flagsFiles Changed
internal/cli/scheduler/configurations.gointernal/cli/scheduler/configurations_helpers.gointernal/cli/scheduler/configurations_helpers_test.gointernal/cli/scheduler/configurations_command_test.gointernal/cli/scheduler/scheduler_test.godocs/commands/scheduler.mdTest Plan
validateConfigFlags) — valid and invalid values for all enum flagsbuildCreateRequest— file-only, flags-only, flags-override-file scenariosbuildUpdateRequest— file-only, flags-only, flags-override-file scenariosvalidateCreateRequest/validateUpdateRequest— missing fields, empty update detectionformatConfigDetails— full config and minimal config outputnylas scheduler configs create --name "Test" --title "Test" --participants user@example.com --duration 30nylas scheduler configs create --file config.jsonnylas scheduler configs update <id> --buffer-before 5 --conferencing-provider "Google Meet"JIRA: TW-4826