-
-
Notifications
You must be signed in to change notification settings - Fork 7
fix: call_imports #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2209,9 +2209,10 @@ class CallImportSchemaParameterBase(BaseModel): | |
| "Parameter type. One of conversation_id / recording_url / " | ||
| "recording_date / transcript / text / number / boolean / " | ||
| "datetime / url. Exactly one parameter of type " | ||
| "'conversation_id' must be present; at most one each of " | ||
| "'recording_url', 'recording_date', and 'transcript'. Only " | ||
| "'conversation_id' is forced required." | ||
| "'conversation_id' and exactly one of type 'recording_url' " | ||
| "must be present; at most one each of 'recording_date' and " | ||
| "'transcript'. Both conversation_id and recording_url are " | ||
| "forced required." | ||
| ), | ||
| ) | ||
| description: Optional[str] = Field( | ||
|
|
@@ -2223,8 +2224,9 @@ class CallImportSchemaParameterBase(BaseModel): | |
| default=False, | ||
| description=( | ||
| "When True, the parameter must be mapped to a CSV column on " | ||
| "every upload. The ``conversation_id`` parameter is always " | ||
| "required and is force-set to True by the server." | ||
| "every upload. The ``conversation_id`` and ``recording_url`` " | ||
| "parameters are always required and are force-set to True by " | ||
| "the server." | ||
| ), | ||
| ) | ||
|
|
||
|
|
@@ -2279,6 +2281,11 @@ def _validate_schema_parameters( | |
| "Schema must contain exactly one parameter of type " | ||
| "'conversation_id'." | ||
| ) | ||
| if rec_url_count != 1: | ||
| raise ValueError( | ||
| "Schema must contain exactly one parameter of type " | ||
| "'recording_url'." | ||
|
Comment on lines
2281
to
+2287
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This validation only runs when a schema create or update payload is submitted. Existing schemas that were saved without a |
||
| ) | ||
| if recording_date_count > 1: | ||
| raise ValueError( | ||
| "Schema may contain at most one parameter of type " | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.