change github.com/aws/aws-sdk-go to be the same revision in kubernetes

This commit is contained in:
Jingfang Liu
2018-10-16 09:34:22 -07:00
parent e0958159f3
commit c6a78cee92
462 changed files with 20605 additions and 85780 deletions

View File

@@ -10,8 +10,6 @@ import (
"sort"
"strings"
"text/template"
"github.com/aws/aws-sdk-go/private/protocol"
)
// ErrorInfo represents the error block of a shape's structure
@@ -43,10 +41,9 @@ type ShapeRef struct {
Ignore bool
XMLNamespace XMLInfo
Payload string
IdempotencyToken bool `json:"idempotencyToken"`
TimestampFormat string `json:"timestampFormat"`
JSONValue bool `json:"jsonvalue"`
Deprecated bool `json:"deprecated"`
IdempotencyToken bool `json:"idempotencyToken"`
JSONValue bool `json:"jsonvalue"`
Deprecated bool `json:"deprecated"`
OrigShapeName string `json:"-"`
@@ -75,8 +72,7 @@ type Shape struct {
Streaming bool
Location string
LocationName string
IdempotencyToken bool `json:"idempotencyToken"`
TimestampFormat string `json:"timestampFormat"`
IdempotencyToken bool `json:"idempotencyToken"`
XMLNamespace XMLInfo
Min float64 // optional Minimum length (string, list) or value (number)
Max float64 // optional Maximum length (string, list) or value (number)
@@ -103,10 +99,6 @@ type Shape struct {
// Error information that is set if the shape is an error shape.
IsError bool
ErrorInfo ErrorInfo `json:"error"`
// Flags that the shape cannot be rename. Prevents the shape from being
// renamed further by the Input/Output.
AliasedShapeName bool
}
// ErrorCodeName will return the error shape's name formated for
@@ -155,11 +147,6 @@ func (s *Shape) GoTags(root, required bool) string {
// Rename changes the name of the Shape to newName. Also updates
// the associated API's reference to use newName.
func (s *Shape) Rename(newName string) {
if s.AliasedShapeName {
panic(fmt.Sprintf("attempted to rename %s, but flagged as aliased",
s.ShapeName))
}
for _, r := range s.refs {
r.OrigShapeName = r.ShapeName
r.ShapeName = newName
@@ -216,32 +203,6 @@ func (s *ShapeRef) UseIndirection() bool {
return true
}
func (s Shape) GetTimestampFormat() string {
format := s.TimestampFormat
if len(format) > 0 && !protocol.IsKnownTimestampFormat(format) {
panic(fmt.Sprintf("Unknown timestampFormat %s, for %s",
format, s.ShapeName))
}
return format
}
func (ref ShapeRef) GetTimestampFormat() string {
format := ref.TimestampFormat
if len(format) == 0 {
format = ref.Shape.TimestampFormat
}
if len(format) > 0 && !protocol.IsKnownTimestampFormat(format) {
panic(fmt.Sprintf("Unknown timestampFormat %s, for %s",
format, ref.ShapeName))
}
return format
}
// GoStructValueType returns the Shape's Go type value instead of a pointer
// for the type.
func (s *Shape) GoStructValueType(name string, ref *ShapeRef) string {
@@ -334,7 +295,7 @@ func goType(s *Shape, withPkgName bool) string {
return "*string"
case "blob":
return "[]byte"
case "byte", "short", "integer", "long":
case "integer", "long":
return "*int64"
case "float", "double":
return "*float64"
@@ -407,17 +368,12 @@ func (ref *ShapeRef) GoTags(toplevel bool, isRequired bool) string {
tags = append(tags, ShapeTag{"location", ref.Location})
} else if ref.Shape.Location != "" {
tags = append(tags, ShapeTag{"location", ref.Shape.Location})
} else if ref.IsEventHeader {
tags = append(tags, ShapeTag{"location", "header"})
}
if ref.LocationName != "" {
tags = append(tags, ShapeTag{"locationName", ref.LocationName})
} else if ref.Shape.LocationName != "" {
tags = append(tags, ShapeTag{"locationName", ref.Shape.LocationName})
} else if len(ref.Shape.EventFor) != 0 && ref.API.Metadata.Protocol == "rest-xml" {
// RPC JSON events need to have location name modeled for round trip testing.
tags = append(tags, ShapeTag{"locationName", ref.Shape.ShapeName})
}
if ref.QueryName != "" {
@@ -445,12 +401,18 @@ func (ref *ShapeRef) GoTags(toplevel bool, isRequired bool) string {
// embed the timestamp type for easier lookups
if ref.Shape.Type == "timestamp" {
if format := ref.GetTimestampFormat(); len(format) > 0 {
tags = append(tags, ShapeTag{
Key: "timestampFormat",
Val: format,
})
t := ShapeTag{Key: "timestampFormat"}
if ref.Location == "header" {
t.Val = "rfc822"
} else {
switch ref.API.Metadata.Protocol {
case "json", "rest-json":
t.Val = "unix"
case "rest-xml", "ec2", "query":
t.Val = "iso8601"
}
}
tags = append(tags, t)
}
if ref.Shape.Flattened || ref.Flattened {
@@ -598,12 +560,6 @@ var structShapeTmpl = func() *template.Template {
shapeTmpl.AddParseTree(
"eventStreamEventShapeTmpl", eventStreamEventShapeTmpl.Tree),
)
template.Must(
shapeTmpl.AddParseTree(
"eventStreamExceptionEventShapeTmpl",
eventStreamExceptionEventShapeTmpl.Tree),
)
shapeTmpl.Funcs(eventStreamEventShapeTmplFuncs)
return shapeTmpl
}()
@@ -642,13 +598,13 @@ type {{ .ShapeName }} struct {
{{ if not .API.NoStringerMethods }}
{{ .GoCodeStringers }}
{{ end }}
{{ if not (or .API.NoValidataShapeMethods .Exception) }}
{{ if not .API.NoValidataShapeMethods }}
{{ if .Validations -}}
{{ .Validations.GoCode . }}
{{ end }}
{{ end }}
{{ if not (or .API.NoGenStructFieldAccessors .Exception) }}
{{ if not .API.NoGenStructFieldAccessors }}
{{ $builderShapeName := print .ShapeName -}}
{{ range $_, $name := $context.MemberNames -}}
{{ $elem := index $context.MemberRefs $name -}}
@@ -682,12 +638,8 @@ type {{ .ShapeName }} struct {
{{ template "eventStreamAPILoopMethodTmpl" $ }}
{{ end }}
{{ if $.EventFor }}
{{ if $.IsEvent }}
{{ template "eventStreamEventShapeTmpl" $ }}
{{- if $.Exception }}
{{ template "eventStreamExceptionEventShapeTmpl" $ }}
{{ end -}}
{{ end }}
`
@@ -790,48 +742,3 @@ func (s *Shape) WillRefBeBase64Encoded(refName string) bool {
return ref.Shape.Type == "blob"
}
// Clone returns a cloned version of the shape with all references clones.
//
// Does not clone EventStream or Validate related values.
func (s *Shape) Clone(newName string) *Shape {
if s.AliasedShapeName {
panic(fmt.Sprintf("attempted to clone and rename %s, but flagged as aliased",
s.ShapeName))
}
n := new(Shape)
*n = *s
debugLogger.Logln("cloning", s.ShapeName, "to", newName)
n.MemberRefs = map[string]*ShapeRef{}
for k, r := range s.MemberRefs {
nr := new(ShapeRef)
*nr = *r
nr.Shape.refs = append(nr.Shape.refs, nr)
n.MemberRefs[k] = nr
}
if n.MemberRef.Shape != nil {
n.MemberRef.Shape.refs = append(n.MemberRef.Shape.refs, &n.MemberRef)
}
if n.KeyRef.Shape != nil {
n.KeyRef.Shape.refs = append(n.KeyRef.Shape.refs, &n.KeyRef)
}
if n.ValueRef.Shape != nil {
n.ValueRef.Shape.refs = append(n.ValueRef.Shape.refs, &n.ValueRef)
}
n.refs = []*ShapeRef{}
n.Required = append([]string{}, n.Required...)
n.Enum = append([]string{}, n.Enum...)
n.EnumConsts = append([]string{}, n.EnumConsts...)
n.OrigShapeName = n.ShapeName
n.API.Shapes[newName] = n
n.ShapeName = newName
return n
}