github.com/yaegashi/msgraph.go@v0.1.4/gen/templates/model.go.tmpl (about)

     1  {{- $ := . }}
     2  {{- $x := .X }}
     3  // {{$x.Sym}} {{$x.Description}}
     4  type {{$x.Sym}} struct {
     5  {{- if ne $x.Base "" }}
     6      // {{$.SymBaseType $x.Base}} is the base model of {{$x.Sym}}
     7      {{$.SymBaseType $x.Base}}
     8  {{- else }}
     9      // Object is the base model of {{$x.Sym}}
    10      Object
    11  {{- end }}
    12  {{- range $y := .X.Members }}
    13  {{- $yTypeType := $.TypeFromType $y.Type }}
    14      // {{$y.Sym}} {{$y.Description}}
    15      {{$y.Sym}} {{$yTypeType}} `json:"{{$y.Name}},omitempty"`
    16  {{- end }}
    17  {{- range $y := .X.Navigations }}
    18  {{- $yTypeType := $.TypeFromType $y.Type }}
    19      // {{$y.Sym}} {{$y.Description}}
    20      {{$y.Sym}} {{$yTypeType}} `json:"{{$y.Name}},omitempty"`
    21  {{- end }}
    22  }