examples_builder.go 635 B

123456789101112131415161718192021222324252627
  1. // +build codegen
  2. package api
  3. type examplesBuilder interface {
  4. BuildShape(*ShapeRef, map[string]interface{}, bool) string
  5. BuildList(string, string, *ShapeRef, []interface{}) string
  6. BuildComplex(string, string, *ShapeRef, map[string]interface{}) string
  7. GoType(*ShapeRef, bool) string
  8. Imports(*API) string
  9. }
  10. type defaultExamplesBuilder struct {
  11. ShapeValueBuilder
  12. }
  13. func (builder defaultExamplesBuilder) Imports(a *API) string {
  14. return `"fmt"
  15. "strings"
  16. "time"
  17. "` + SDKImportRoot + `/aws"
  18. "` + SDKImportRoot + `/aws/awserr"
  19. "` + SDKImportRoot + `/aws/session"
  20. "` + SDKImportRoot + `/service/` + a.PackageName() + `"
  21. `
  22. }