package reportingcrds /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1 * User agent: apibuilder app.apibuilder.io/nccloud/reporting-crds/0.0.1/go_1_5_client */ import ( "bytes" "de/nccloud/reporting/api" "encoding/json" "io" ) const UserAgent = "apibuilder app.apibuilder.io/nccloud/reporting-crds/0.0.1/go_1_5_client" const Version = "0.0.1" const VersionMajor = 0 type ReportStream struct { Topic string `json:"topic"` Description string `json:"description"` Service string `json:"service"` Schema map[string]api.Field `json:"schema"` } func ReportStreamFromMap(data interface{}) ReportStream { b, err := json.Marshal(data) if err == nil { return ReportStreamFromJson(bytes.NewReader(b)) } else { panic(err) } } func ReportStreamFromJson(bytes io.Reader) ReportStream { var reportStream ReportStream json.NewDecoder(bytes).Decode(&reportStream) return reportStream }