Skip to content

Commit

Permalink
Use a blank indentifier instead of an anonymous field for SDKShapeTraits
Browse files Browse the repository at this point in the history
  • Loading branch information
bpot committed Nov 25, 2015
1 parent 9d7bc2d commit d5e1e43
Show file tree
Hide file tree
Showing 80 changed files with 4,957 additions and 24,738 deletions.
11 changes: 3 additions & 8 deletions aws/corehandlers/param_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ type StructShape struct {
OptionalStruct *ConditionalStructShape

hiddenParameter *string

metadataStructureShape
}

type metadataStructureShape struct {
SDKShapeTraits bool
_ struct{}
}

type ConditionalStructShape struct {
Name *string `required:"true"`
SDKShapeTraits bool
Name *string `required:"true"`
_ struct{}
}

func TestNoErrors(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions private/model/api/passes.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ func (a *API) renameExportable() {
}
}

if newName == "SDKShapeTraits" {
panic("Shape " + s.ShapeName + " uses reserved member name SDKShapeTraits")
if newName == "_" {
panic("Shape " + s.ShapeName + " uses reserved member name '_'")
}
}

Expand Down
6 changes: 1 addition & 5 deletions private/model/api/shape.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,8 @@ func (s *Shape) GoCode() string {
code += n + " " + m.GoType() + " " + m.GoTags(false, s.IsRequired(n)) + "\n\n"
}
}
metaStruct := "metadata" + s.ShapeName
ref := &ShapeRef{ShapeName: s.ShapeName, API: s.API, Shape: s}
code += "\n" + metaStruct + " `json:\"-\" xml:\"-\"`\n"
code += "}\n\n"
code += "type " + metaStruct + " struct {\n"
code += "SDKShapeTraits bool " + ref.GoTags(true, false)
code += "_ struct{} " + ref.GoTags(true, false)
code += "}"

if !s.API.NoStringerMethods {
Expand Down
102 changes: 17 additions & 85 deletions private/protocol/ec2query/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,11 @@ type InputService1TestShapeInputService1TestCaseOperation1Input struct {

Foo *string `type:"string"`

metadataInputService1TestShapeInputService1TestCaseOperation1Input `json:"-" xml:"-"`
}

type metadataInputService1TestShapeInputService1TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService1TestShapeInputService1TestCaseOperation1Output struct {
metadataInputService1TestShapeInputService1TestCaseOperation1Output `json:"-" xml:"-"`
}

type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

//The service client's operations are safe to be used concurrently.
Expand Down Expand Up @@ -220,19 +212,11 @@ type InputService2TestShapeInputService2TestCaseOperation1Input struct {

Yuck *string `locationName:"yuckLocationName" queryName:"yuckQueryName" type:"string"`

metadataInputService2TestShapeInputService2TestCaseOperation1Input `json:"-" xml:"-"`
}

type metadataInputService2TestShapeInputService2TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService2TestShapeInputService2TestCaseOperation1Output struct {
metadataInputService2TestShapeInputService2TestCaseOperation1Output `json:"-" xml:"-"`
}

type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

//The service client's operations are safe to be used concurrently.
Expand Down Expand Up @@ -316,29 +300,17 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *Input
type InputService3TestShapeInputService3TestCaseOperation1Input struct {
StructArg *InputService3TestShapeStructType `locationName:"Struct" type:"structure"`

metadataInputService3TestShapeInputService3TestCaseOperation1Input `json:"-" xml:"-"`
}

type metadataInputService3TestShapeInputService3TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService3TestShapeInputService3TestCaseOperation1Output struct {
metadataInputService3TestShapeInputService3TestCaseOperation1Output `json:"-" xml:"-"`
}

type metadataInputService3TestShapeInputService3TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService3TestShapeStructType struct {
ScalarArg *string `locationName:"Scalar" type:"string"`

metadataInputService3TestShapeStructType `json:"-" xml:"-"`
}

type metadataInputService3TestShapeStructType struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

//The service client's operations are safe to be used concurrently.
Expand Down Expand Up @@ -422,19 +394,11 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *Input
type InputService4TestShapeInputService4TestCaseOperation1Input struct {
ListArg []*string `type:"list"`

metadataInputService4TestShapeInputService4TestCaseOperation1Input `json:"-" xml:"-"`
}

type metadataInputService4TestShapeInputService4TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService4TestShapeInputService4TestCaseOperation1Output struct {
metadataInputService4TestShapeInputService4TestCaseOperation1Output `json:"-" xml:"-"`
}

type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

//The service client's operations are safe to be used concurrently.
Expand Down Expand Up @@ -518,19 +482,11 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *Input
type InputService5TestShapeInputService5TestCaseOperation1Input struct {
ListArg []*string `locationName:"ListMemberName" locationNameList:"item" type:"list"`

metadataInputService5TestShapeInputService5TestCaseOperation1Input `json:"-" xml:"-"`
}

type metadataInputService5TestShapeInputService5TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService5TestShapeInputService5TestCaseOperation1Output struct {
metadataInputService5TestShapeInputService5TestCaseOperation1Output `json:"-" xml:"-"`
}

type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

//The service client's operations are safe to be used concurrently.
Expand Down Expand Up @@ -614,19 +570,11 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *Input
type InputService6TestShapeInputService6TestCaseOperation1Input struct {
ListArg []*string `locationName:"ListMemberName" queryName:"ListQueryName" locationNameList:"item" type:"list"`

metadataInputService6TestShapeInputService6TestCaseOperation1Input `json:"-" xml:"-"`
}

type metadataInputService6TestShapeInputService6TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService6TestShapeInputService6TestCaseOperation1Output struct {
metadataInputService6TestShapeInputService6TestCaseOperation1Output `json:"-" xml:"-"`
}

type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

//The service client's operations are safe to be used concurrently.
Expand Down Expand Up @@ -710,19 +658,11 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *Input
type InputService7TestShapeInputService7TestCaseOperation1Input struct {
BlobArg []byte `type:"blob"`

metadataInputService7TestShapeInputService7TestCaseOperation1Input `json:"-" xml:"-"`
}

type metadataInputService7TestShapeInputService7TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService7TestShapeInputService7TestCaseOperation1Output struct {
metadataInputService7TestShapeInputService7TestCaseOperation1Output `json:"-" xml:"-"`
}

type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

//The service client's operations are safe to be used concurrently.
Expand Down Expand Up @@ -806,19 +746,11 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *Input
type InputService8TestShapeInputService8TestCaseOperation1Input struct {
TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"`

metadataInputService8TestShapeInputService8TestCaseOperation1Input `json:"-" xml:"-"`
}

type metadataInputService8TestShapeInputService8TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

type InputService8TestShapeInputService8TestCaseOperation1Output struct {
metadataInputService8TestShapeInputService8TestCaseOperation1Output `json:"-" xml:"-"`
}

type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
_ struct{} `type:"structure"`
}

//
Expand Down
Loading

0 comments on commit d5e1e43

Please sign in to comment.