-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Rauh
committed
Feb 8, 2023
1 parent
0b79d88
commit 0bcf99a
Showing
6 changed files
with
217 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
type: array | ||
description: A list of compounds with associated spectra. | ||
items: | ||
description: Data for a single compound. | ||
type: object | ||
properties: | ||
metadata: | ||
$ref: "./FilterOptions.yaml#/components/schemas/Metadata" | ||
data: | ||
type: object | ||
properties: | ||
metadata: | ||
$ref: "./FilterOptions.yaml#/components/schemas/Metadata" | ||
data: | ||
type: array | ||
description: A list of compounds with associated spectra. | ||
items: | ||
description: Data for a single compound. | ||
type: object | ||
name: | ||
description: Compound name. | ||
type: string | ||
formula: | ||
description: Formula of the compound. | ||
type: string | ||
mass: | ||
description: Exact Mass of the compound. | ||
type: number | ||
format: double | ||
smiles: | ||
description: Smiles to generate structure. | ||
type: string | ||
spectra: | ||
description: A list of spectra for the compound | ||
type: array | ||
items: | ||
description: Spectra for the given compound | ||
type: object | ||
properties: | ||
title: | ||
description: Record title | ||
type: string | ||
id: | ||
description: MassBank ID. | ||
type: string | ||
properties: | ||
|
||
data: | ||
type: object | ||
name: | ||
description: Compound name. | ||
type: string | ||
formula: | ||
description: Formula of the compound. | ||
type: string | ||
mass: | ||
description: Exact Mass of the compound. | ||
type: number | ||
format: double | ||
smiles: | ||
description: Smiles to generate structure. | ||
type: string | ||
spectra: | ||
description: A list of spectra for the compound | ||
type: array | ||
items: | ||
description: Spectra for the given compound | ||
type: object | ||
properties: | ||
title: | ||
description: Record title | ||
type: string | ||
id: | ||
description: MassBank ID. | ||
type: string |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* MassBank3 API | ||
* | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* API version: 3.0 | ||
* Generated by: OpenAPI Generator (https://openapi-generator.tech) | ||
*/ | ||
|
||
package mb3server | ||
|
||
type SearchResult struct { | ||
Metadata Metadata `json:"metadata,omitempty"` | ||
|
||
// A list of compounds with associated spectra. | ||
Data []SearchResultDataInner `json:"data,omitempty"` | ||
} | ||
|
||
// AssertSearchResultRequired checks if the required fields are not zero-ed | ||
func AssertSearchResultRequired(obj SearchResult) error { | ||
if err := AssertMetadataRequired(obj.Metadata); err != nil { | ||
return err | ||
} | ||
for _, el := range obj.Data { | ||
if err := AssertSearchResultDataInnerRequired(el); err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
// AssertRecurseSearchResultRequired recursively checks if required fields are not zero-ed in a nested slice. | ||
// Accepts only nested slice of SearchResult (e.g. [][]SearchResult), otherwise ErrTypeAssertionError is thrown. | ||
func AssertRecurseSearchResultRequired(objSlice interface{}) error { | ||
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { | ||
aSearchResult, ok := obj.(SearchResult) | ||
if !ok { | ||
return ErrTypeAssertionError | ||
} | ||
return AssertSearchResultRequired(aSearchResult) | ||
}) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* MassBank3 API | ||
* | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* API version: 3.0 | ||
* Generated by: OpenAPI Generator (https://openapi-generator.tech) | ||
*/ | ||
|
||
package mb3server | ||
|
||
// SearchResultDataInner - Data for a single compound. | ||
type SearchResultDataInner struct { | ||
Data map[string]interface{} `json:"data,omitempty"` | ||
|
||
// Compound name. | ||
Name string `json:"name,omitempty"` | ||
|
||
// Formula of the compound. | ||
Formula string `json:"formula,omitempty"` | ||
|
||
// Exact Mass of the compound. | ||
Mass float64 `json:"mass,omitempty"` | ||
|
||
// Smiles to generate structure. | ||
Smiles string `json:"smiles,omitempty"` | ||
|
||
// A list of spectra for the compound | ||
Spectra []SearchResultDataInnerSpectraInner `json:"spectra,omitempty"` | ||
} | ||
|
||
// AssertSearchResultDataInnerRequired checks if the required fields are not zero-ed | ||
func AssertSearchResultDataInnerRequired(obj SearchResultDataInner) error { | ||
for _, el := range obj.Spectra { | ||
if err := AssertSearchResultDataInnerSpectraInnerRequired(el); err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
// AssertRecurseSearchResultDataInnerRequired recursively checks if required fields are not zero-ed in a nested slice. | ||
// Accepts only nested slice of SearchResultDataInner (e.g. [][]SearchResultDataInner), otherwise ErrTypeAssertionError is thrown. | ||
func AssertRecurseSearchResultDataInnerRequired(objSlice interface{}) error { | ||
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { | ||
aSearchResultDataInner, ok := obj.(SearchResultDataInner) | ||
if !ok { | ||
return ErrTypeAssertionError | ||
} | ||
return AssertSearchResultDataInnerRequired(aSearchResultDataInner) | ||
}) | ||
} |
37 changes: 37 additions & 0 deletions
37
cmd/mb3server/src/model_search_result_data_inner_spectra_inner.go
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* MassBank3 API | ||
* | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* API version: 3.0 | ||
* Generated by: OpenAPI Generator (https://openapi-generator.tech) | ||
*/ | ||
|
||
package mb3server | ||
|
||
// SearchResultDataInnerSpectraInner - Spectra for the given compound | ||
type SearchResultDataInnerSpectraInner struct { | ||
|
||
// Record title | ||
Title string `json:"title,omitempty"` | ||
|
||
// MassBank ID. | ||
Id string `json:"id,omitempty"` | ||
} | ||
|
||
// AssertSearchResultDataInnerSpectraInnerRequired checks if the required fields are not zero-ed | ||
func AssertSearchResultDataInnerSpectraInnerRequired(obj SearchResultDataInnerSpectraInner) error { | ||
return nil | ||
} | ||
|
||
// AssertRecurseSearchResultDataInnerSpectraInnerRequired recursively checks if required fields are not zero-ed in a nested slice. | ||
// Accepts only nested slice of SearchResultDataInnerSpectraInner (e.g. [][]SearchResultDataInnerSpectraInner), otherwise ErrTypeAssertionError is thrown. | ||
func AssertRecurseSearchResultDataInnerSpectraInnerRequired(objSlice interface{}) error { | ||
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { | ||
aSearchResultDataInnerSpectraInner, ok := obj.(SearchResultDataInnerSpectraInner) | ||
if !ok { | ||
return ErrTypeAssertionError | ||
} | ||
return AssertSearchResultDataInnerSpectraInnerRequired(aSearchResultDataInnerSpectraInner) | ||
}) | ||
} |