File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -73,3 +73,27 @@ func (s *SearchMatch) UnmarshalJSON(b []byte) error {
7373 }
7474 return nil
7575}
76+
77+ type deleteResult struct {
78+ FileOpsResult
79+ Metadata metadataUnion `json:"metadata"`
80+ }
81+
82+ // UnmarshalJSON deserializes into a SearchMatch instance
83+ func (s * DeleteResult ) UnmarshalJSON (b []byte ) error {
84+ var m deleteResult
85+ if err := json .Unmarshal (b , & m ); err != nil {
86+ return err
87+ }
88+ s .FileOpsResult = m .FileOpsResult
89+ e := m .Metadata
90+ switch e .Tag {
91+ case "file" :
92+ s .Metadata = e .File
93+ case "folder" :
94+ s .Metadata = e .Folder
95+ case "deleted" :
96+ s .Metadata = e .Deleted
97+ }
98+ return nil
99+ }
Original file line number Diff line number Diff line change @@ -73,3 +73,27 @@ func (s *SearchMatch) UnmarshalJSON(b []byte) error {
7373 }
7474 return nil
7575}
76+
77+ type deleteResult struct {
78+ FileOpsResult
79+ Metadata metadataUnion `json:"metadata"`
80+ }
81+
82+ // UnmarshalJSON deserializes into a SearchMatch instance
83+ func (s * DeleteResult ) UnmarshalJSON (b []byte ) error {
84+ var m deleteResult
85+ if err := json .Unmarshal (b , & m ); err != nil {
86+ return err
87+ }
88+ s .FileOpsResult = m .FileOpsResult
89+ e := m .Metadata
90+ switch e .Tag {
91+ case "file" :
92+ s .Metadata = e .File
93+ case "folder" :
94+ s .Metadata = e .Folder
95+ case "deleted" :
96+ s .Metadata = e .Deleted
97+ }
98+ return nil
99+ }
You can’t perform that action at this time.
0 commit comments