@@ -4108,15 +4108,92 @@ func (expect *DialogExpectation) UnmarshalJSON(data []byte) error {
41084108
41094109func (dialog * Dialog ) UnmarshalJSON (data []byte ) error {
41104110 data = normalizeStringFieldsToArray (data ,
4111- "actions" ,
41124111 "Actions" ,
4112+ "actions" ,
4113+ "Options" ,
41134114 "options" ,
4115+ "Choices" ,
41144116 "choices" ,
4117+ "Buttons" ,
41154118 "buttons" ,
41164119 )
41174120 type alias Dialog
41184121 var raw alias
4119- if err := json .Unmarshal (data , & raw ); err != nil {
4122+ if err := json .Unmarshal (stripJSONAliasFields (data ,
4123+ "ID" ,
4124+ "id" ,
4125+ "DialogID" ,
4126+ "dialog_id" ,
4127+ "dialogId" ,
4128+ "dialogID" ,
4129+ "PermissionID" ,
4130+ "permission_id" ,
4131+ "permissionId" ,
4132+ "permissionID" ,
4133+ "RequestID" ,
4134+ "request_id" ,
4135+ "requestId" ,
4136+ "requestID" ,
4137+ "ToolUseID" ,
4138+ "tool_use_id" ,
4139+ "toolUseId" ,
4140+ "toolUseID" ,
4141+ "OperationID" ,
4142+ "operation_id" ,
4143+ "operationId" ,
4144+ "operationID" ,
4145+ "Kind" ,
4146+ "kind" ,
4147+ "DialogKind" ,
4148+ "dialog_kind" ,
4149+ "dialogKind" ,
4150+ "DialogType" ,
4151+ "dialog_type" ,
4152+ "dialogType" ,
4153+ "Title" ,
4154+ "title" ,
4155+ "Heading" ,
4156+ "heading" ,
4157+ "Header" ,
4158+ "header" ,
4159+ "Label" ,
4160+ "label" ,
4161+ "Name" ,
4162+ "name" ,
4163+ "Body" ,
4164+ "body" ,
4165+ "Content" ,
4166+ "content" ,
4167+ "Text" ,
4168+ "text" ,
4169+ "Message" ,
4170+ "message" ,
4171+ "Description" ,
4172+ "description" ,
4173+ "Actions" ,
4174+ "actions" ,
4175+ "Options" ,
4176+ "options" ,
4177+ "Choices" ,
4178+ "choices" ,
4179+ "Buttons" ,
4180+ "buttons" ,
4181+ "Focused" ,
4182+ "focused" ,
4183+ "FocusedIndex" ,
4184+ "focused_index" ,
4185+ "focusedIndex" ,
4186+ "FocusIndex" ,
4187+ "focus_index" ,
4188+ "focusIndex" ,
4189+ "SelectedIndex" ,
4190+ "selected_index" ,
4191+ "selectedIndex" ,
4192+ "Focus" ,
4193+ "focus" ,
4194+ "Selected" ,
4195+ "selected" ,
4196+ ), & raw ); err != nil {
41204197 return err
41214198 }
41224199 * dialog = Dialog (raw )
@@ -4125,26 +4202,26 @@ func (dialog *Dialog) UnmarshalJSON(data []byte) error {
41254202 if err := json .Unmarshal (data , & fields ); err != nil {
41264203 return err
41274204 }
4205+ if dialog .ID == "" {
4206+ dialog .ID = scalarStringJSONField (fields , "ID" , "id" , "DialogID" , "dialog_id" , "dialogId" , "dialogID" , "PermissionID" , "permission_id" , "permissionId" , "permissionID" , "RequestID" , "request_id" , "requestId" , "requestID" , "ToolUseID" , "tool_use_id" , "toolUseId" , "toolUseID" , "OperationID" , "operation_id" , "operationId" , "operationID" )
4207+ }
4208+ if dialog .Kind == "" {
4209+ if dialogKind := stringJSONField (fields , "Kind" , "kind" , "DialogKind" , "dialog_kind" , "dialogKind" , "DialogType" , "dialog_type" , "dialogType" ); dialogKind != "" {
4210+ dialog .Kind = DialogKind (dialogKind )
4211+ }
4212+ }
41284213 if dialog .Title == "" {
4129- dialog .Title = stringJSONField (fields , "heading" , "header" , "label" , "name" )
4214+ dialog .Title = stringJSONField (fields , "Title" , "title" , "Heading" , " heading" , "Header" , " header" , "Label" , " label" , "Name " , "name" )
41304215 }
41314216 if dialog .Body == "" {
4132- dialog .Body = stringJSONField (fields , "content" , "text" , "message" , "description" )
4217+ dialog .Body = stringJSONField (fields , "Body" , "body" , "Content" , " content" , "Text" , " text" , "Message" , " message" , "Description " , "description" )
41334218 }
41344219 if len (dialog .Actions ) == 0 {
4135- dialog .Actions = stringListJSONField (fields , "options" , "choices" , "buttons" )
4220+ dialog .Actions = stringListJSONField (fields , "Actions" , "actions" , "Options" , " options" , "Choices" , " choices" , "Buttons " , "buttons" )
41364221 }
4137- if focused := intPtrJSONField (fields , "focused_index" , "focusedIndex" , "selected_index" , "selectedIndex" , "focus" , "selected" ); focused != nil {
4222+ if focused := intPtrJSONField (fields , "Focused" , "focused" , "FocusedIndex" , " focused_index" , "focusedIndex" , "FocusIndex" , "focus_index" , "focusIndex" , "SelectedIndex" , " selected_index" , "selectedIndex" , "Focus" , " focus" , "Selected " , "selected" ); focused != nil {
41384223 dialog .Focused = * focused
41394224 }
4140- if dialog .ID == "" {
4141- dialog .ID = scalarStringJSONField (fields , "dialog_id" , "dialogId" , "dialogID" , "permission_id" , "permissionId" , "permissionID" , "request_id" , "requestId" , "requestID" , "tool_use_id" , "toolUseId" , "toolUseID" , "operation_id" , "operationId" , "operationID" )
4142- }
4143- if dialog .Kind == "" {
4144- if dialogKind := stringJSONField (fields , "dialog_kind" , "dialogKind" ); dialogKind != "" {
4145- dialog .Kind = DialogKind (dialogKind )
4146- }
4147- }
41484225 return nil
41494226}
41504227
0 commit comments