unmarshal_test.go 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778
  1. package restxml_test
  2. import (
  3. "bytes"
  4. "encoding/json"
  5. "encoding/xml"
  6. "fmt"
  7. "io"
  8. "io/ioutil"
  9. "net/http"
  10. "net/url"
  11. "testing"
  12. "time"
  13. "github.com/aws/aws-sdk-go/aws"
  14. "github.com/aws/aws-sdk-go/aws/client"
  15. "github.com/aws/aws-sdk-go/aws/client/metadata"
  16. "github.com/aws/aws-sdk-go/aws/request"
  17. "github.com/aws/aws-sdk-go/aws/signer/v4"
  18. "github.com/aws/aws-sdk-go/awstesting"
  19. "github.com/aws/aws-sdk-go/awstesting/unit"
  20. "github.com/aws/aws-sdk-go/private/protocol"
  21. "github.com/aws/aws-sdk-go/private/protocol/restxml"
  22. "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
  23. "github.com/aws/aws-sdk-go/private/util"
  24. "github.com/stretchr/testify/assert"
  25. )
  26. var _ bytes.Buffer // always import bytes
  27. var _ http.Request
  28. var _ json.Marshaler
  29. var _ time.Time
  30. var _ xmlutil.XMLNode
  31. var _ xml.Attr
  32. var _ = ioutil.Discard
  33. var _ = util.Trim("")
  34. var _ = url.Values{}
  35. var _ = io.EOF
  36. var _ = aws.String
  37. var _ = fmt.Println
  38. func init() {
  39. protocol.RandReader = &awstesting.ZeroReader{}
  40. }
  41. //The service client's operations are safe to be used concurrently.
  42. // It is not safe to mutate any of the client's properties though.
  43. type OutputService1ProtocolTest struct {
  44. *client.Client
  45. }
  46. // New creates a new instance of the OutputService1ProtocolTest client with a session.
  47. // If additional configuration is needed for the client instance use the optional
  48. // aws.Config parameter to add your extra config.
  49. //
  50. // Example:
  51. // // Create a OutputService1ProtocolTest client from just a session.
  52. // svc := outputservice1protocoltest.New(mySession)
  53. //
  54. // // Create a OutputService1ProtocolTest client with additional configuration
  55. // svc := outputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  56. func NewOutputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService1ProtocolTest {
  57. c := p.ClientConfig("outputservice1protocoltest", cfgs...)
  58. return newOutputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  59. }
  60. // newClient creates, initializes and returns a new service client instance.
  61. func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService1ProtocolTest {
  62. svc := &OutputService1ProtocolTest{
  63. Client: client.New(
  64. cfg,
  65. metadata.ClientInfo{
  66. ServiceName: "outputservice1protocoltest",
  67. SigningRegion: signingRegion,
  68. Endpoint: endpoint,
  69. APIVersion: "",
  70. },
  71. handlers,
  72. ),
  73. }
  74. // Handlers
  75. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  76. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  77. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  78. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  79. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  80. return svc
  81. }
  82. // newRequest creates a new request for a OutputService1ProtocolTest operation and runs any
  83. // custom request initialization.
  84. func (c *OutputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  85. req := c.NewRequest(op, params, data)
  86. return req
  87. }
  88. const opOutputService1TestCaseOperation1 = "OperationName"
  89. // OutputService1TestCaseOperation1Request generates a "aws/request.Request" representing the
  90. // client's request for the OutputService1TestCaseOperation1 operation. The "output" return
  91. // value can be used to capture response data after the request's "Send" method
  92. // is called.
  93. //
  94. // Creating a request object using this method should be used when you want to inject
  95. // custom logic into the request's lifecycle using a custom handler, or if you want to
  96. // access properties on the request object before or after sending the request. If
  97. // you just want the service response, call the OutputService1TestCaseOperation1 method directly
  98. // instead.
  99. //
  100. // Note: You must call the "Send" method on the returned request object in order
  101. // to execute the request.
  102. //
  103. // // Example sending a request using the OutputService1TestCaseOperation1Request method.
  104. // req, resp := client.OutputService1TestCaseOperation1Request(params)
  105. //
  106. // err := req.Send()
  107. // if err == nil { // resp is now filled
  108. // fmt.Println(resp)
  109. // }
  110. //
  111. func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *request.Request, output *OutputService1TestShapeOutputShape) {
  112. op := &request.Operation{
  113. Name: opOutputService1TestCaseOperation1,
  114. HTTPPath: "/",
  115. }
  116. if input == nil {
  117. input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{}
  118. }
  119. req = c.newRequest(op, input, output)
  120. output = &OutputService1TestShapeOutputShape{}
  121. req.Data = output
  122. return
  123. }
  124. func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputShape, error) {
  125. req, out := c.OutputService1TestCaseOperation1Request(input)
  126. err := req.Send()
  127. return out, err
  128. }
  129. const opOutputService1TestCaseOperation2 = "OperationName"
  130. // OutputService1TestCaseOperation2Request generates a "aws/request.Request" representing the
  131. // client's request for the OutputService1TestCaseOperation2 operation. The "output" return
  132. // value can be used to capture response data after the request's "Send" method
  133. // is called.
  134. //
  135. // Creating a request object using this method should be used when you want to inject
  136. // custom logic into the request's lifecycle using a custom handler, or if you want to
  137. // access properties on the request object before or after sending the request. If
  138. // you just want the service response, call the OutputService1TestCaseOperation2 method directly
  139. // instead.
  140. //
  141. // Note: You must call the "Send" method on the returned request object in order
  142. // to execute the request.
  143. //
  144. // // Example sending a request using the OutputService1TestCaseOperation2Request method.
  145. // req, resp := client.OutputService1TestCaseOperation2Request(params)
  146. //
  147. // err := req.Send()
  148. // if err == nil { // resp is now filled
  149. // fmt.Println(resp)
  150. // }
  151. //
  152. func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation2Request(input *OutputService1TestShapeOutputService1TestCaseOperation2Input) (req *request.Request, output *OutputService1TestShapeOutputShape) {
  153. op := &request.Operation{
  154. Name: opOutputService1TestCaseOperation2,
  155. HTTPPath: "/",
  156. }
  157. if input == nil {
  158. input = &OutputService1TestShapeOutputService1TestCaseOperation2Input{}
  159. }
  160. req = c.newRequest(op, input, output)
  161. output = &OutputService1TestShapeOutputShape{}
  162. req.Data = output
  163. return
  164. }
  165. func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation2(input *OutputService1TestShapeOutputService1TestCaseOperation2Input) (*OutputService1TestShapeOutputShape, error) {
  166. req, out := c.OutputService1TestCaseOperation2Request(input)
  167. err := req.Send()
  168. return out, err
  169. }
  170. type OutputService1TestShapeOutputService1TestCaseOperation1Input struct {
  171. _ struct{} `type:"structure"`
  172. }
  173. type OutputService1TestShapeOutputService1TestCaseOperation2Input struct {
  174. _ struct{} `type:"structure"`
  175. }
  176. type OutputService1TestShapeOutputShape struct {
  177. _ struct{} `type:"structure"`
  178. Char *string `type:"character"`
  179. Double *float64 `type:"double"`
  180. FalseBool *bool `type:"boolean"`
  181. Float *float64 `type:"float"`
  182. ImaHeader *string `location:"header" type:"string"`
  183. ImaHeaderLocation *string `location:"header" locationName:"X-Foo" type:"string"`
  184. Long *int64 `type:"long"`
  185. Num *int64 `locationName:"FooNum" type:"integer"`
  186. Str *string `type:"string"`
  187. Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  188. TrueBool *bool `type:"boolean"`
  189. }
  190. //The service client's operations are safe to be used concurrently.
  191. // It is not safe to mutate any of the client's properties though.
  192. type OutputService2ProtocolTest struct {
  193. *client.Client
  194. }
  195. // New creates a new instance of the OutputService2ProtocolTest client with a session.
  196. // If additional configuration is needed for the client instance use the optional
  197. // aws.Config parameter to add your extra config.
  198. //
  199. // Example:
  200. // // Create a OutputService2ProtocolTest client from just a session.
  201. // svc := outputservice2protocoltest.New(mySession)
  202. //
  203. // // Create a OutputService2ProtocolTest client with additional configuration
  204. // svc := outputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  205. func NewOutputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService2ProtocolTest {
  206. c := p.ClientConfig("outputservice2protocoltest", cfgs...)
  207. return newOutputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  208. }
  209. // newClient creates, initializes and returns a new service client instance.
  210. func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService2ProtocolTest {
  211. svc := &OutputService2ProtocolTest{
  212. Client: client.New(
  213. cfg,
  214. metadata.ClientInfo{
  215. ServiceName: "outputservice2protocoltest",
  216. SigningRegion: signingRegion,
  217. Endpoint: endpoint,
  218. APIVersion: "",
  219. },
  220. handlers,
  221. ),
  222. }
  223. // Handlers
  224. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  225. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  226. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  227. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  228. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  229. return svc
  230. }
  231. // newRequest creates a new request for a OutputService2ProtocolTest operation and runs any
  232. // custom request initialization.
  233. func (c *OutputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  234. req := c.NewRequest(op, params, data)
  235. return req
  236. }
  237. const opOutputService2TestCaseOperation1 = "OperationName"
  238. // OutputService2TestCaseOperation1Request generates a "aws/request.Request" representing the
  239. // client's request for the OutputService2TestCaseOperation1 operation. The "output" return
  240. // value can be used to capture response data after the request's "Send" method
  241. // is called.
  242. //
  243. // Creating a request object using this method should be used when you want to inject
  244. // custom logic into the request's lifecycle using a custom handler, or if you want to
  245. // access properties on the request object before or after sending the request. If
  246. // you just want the service response, call the OutputService2TestCaseOperation1 method directly
  247. // instead.
  248. //
  249. // Note: You must call the "Send" method on the returned request object in order
  250. // to execute the request.
  251. //
  252. // // Example sending a request using the OutputService2TestCaseOperation1Request method.
  253. // req, resp := client.OutputService2TestCaseOperation1Request(params)
  254. //
  255. // err := req.Send()
  256. // if err == nil { // resp is now filled
  257. // fmt.Println(resp)
  258. // }
  259. //
  260. func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *request.Request, output *OutputService2TestShapeOutputService2TestCaseOperation1Output) {
  261. op := &request.Operation{
  262. Name: opOutputService2TestCaseOperation1,
  263. HTTPPath: "/",
  264. }
  265. if input == nil {
  266. input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{}
  267. }
  268. req = c.newRequest(op, input, output)
  269. output = &OutputService2TestShapeOutputService2TestCaseOperation1Output{}
  270. req.Data = output
  271. return
  272. }
  273. func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) {
  274. req, out := c.OutputService2TestCaseOperation1Request(input)
  275. err := req.Send()
  276. return out, err
  277. }
  278. type OutputService2TestShapeOutputService2TestCaseOperation1Input struct {
  279. _ struct{} `type:"structure"`
  280. }
  281. type OutputService2TestShapeOutputService2TestCaseOperation1Output struct {
  282. _ struct{} `type:"structure"`
  283. // Blob is automatically base64 encoded/decoded by the SDK.
  284. Blob []byte `type:"blob"`
  285. }
  286. //The service client's operations are safe to be used concurrently.
  287. // It is not safe to mutate any of the client's properties though.
  288. type OutputService3ProtocolTest struct {
  289. *client.Client
  290. }
  291. // New creates a new instance of the OutputService3ProtocolTest client with a session.
  292. // If additional configuration is needed for the client instance use the optional
  293. // aws.Config parameter to add your extra config.
  294. //
  295. // Example:
  296. // // Create a OutputService3ProtocolTest client from just a session.
  297. // svc := outputservice3protocoltest.New(mySession)
  298. //
  299. // // Create a OutputService3ProtocolTest client with additional configuration
  300. // svc := outputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  301. func NewOutputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService3ProtocolTest {
  302. c := p.ClientConfig("outputservice3protocoltest", cfgs...)
  303. return newOutputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  304. }
  305. // newClient creates, initializes and returns a new service client instance.
  306. func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService3ProtocolTest {
  307. svc := &OutputService3ProtocolTest{
  308. Client: client.New(
  309. cfg,
  310. metadata.ClientInfo{
  311. ServiceName: "outputservice3protocoltest",
  312. SigningRegion: signingRegion,
  313. Endpoint: endpoint,
  314. APIVersion: "",
  315. },
  316. handlers,
  317. ),
  318. }
  319. // Handlers
  320. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  321. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  322. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  323. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  324. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  325. return svc
  326. }
  327. // newRequest creates a new request for a OutputService3ProtocolTest operation and runs any
  328. // custom request initialization.
  329. func (c *OutputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  330. req := c.NewRequest(op, params, data)
  331. return req
  332. }
  333. const opOutputService3TestCaseOperation1 = "OperationName"
  334. // OutputService3TestCaseOperation1Request generates a "aws/request.Request" representing the
  335. // client's request for the OutputService3TestCaseOperation1 operation. The "output" return
  336. // value can be used to capture response data after the request's "Send" method
  337. // is called.
  338. //
  339. // Creating a request object using this method should be used when you want to inject
  340. // custom logic into the request's lifecycle using a custom handler, or if you want to
  341. // access properties on the request object before or after sending the request. If
  342. // you just want the service response, call the OutputService3TestCaseOperation1 method directly
  343. // instead.
  344. //
  345. // Note: You must call the "Send" method on the returned request object in order
  346. // to execute the request.
  347. //
  348. // // Example sending a request using the OutputService3TestCaseOperation1Request method.
  349. // req, resp := client.OutputService3TestCaseOperation1Request(params)
  350. //
  351. // err := req.Send()
  352. // if err == nil { // resp is now filled
  353. // fmt.Println(resp)
  354. // }
  355. //
  356. func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *request.Request, output *OutputService3TestShapeOutputService3TestCaseOperation1Output) {
  357. op := &request.Operation{
  358. Name: opOutputService3TestCaseOperation1,
  359. HTTPPath: "/",
  360. }
  361. if input == nil {
  362. input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{}
  363. }
  364. req = c.newRequest(op, input, output)
  365. output = &OutputService3TestShapeOutputService3TestCaseOperation1Output{}
  366. req.Data = output
  367. return
  368. }
  369. func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) {
  370. req, out := c.OutputService3TestCaseOperation1Request(input)
  371. err := req.Send()
  372. return out, err
  373. }
  374. type OutputService3TestShapeOutputService3TestCaseOperation1Input struct {
  375. _ struct{} `type:"structure"`
  376. }
  377. type OutputService3TestShapeOutputService3TestCaseOperation1Output struct {
  378. _ struct{} `type:"structure"`
  379. ListMember []*string `type:"list"`
  380. }
  381. //The service client's operations are safe to be used concurrently.
  382. // It is not safe to mutate any of the client's properties though.
  383. type OutputService4ProtocolTest struct {
  384. *client.Client
  385. }
  386. // New creates a new instance of the OutputService4ProtocolTest client with a session.
  387. // If additional configuration is needed for the client instance use the optional
  388. // aws.Config parameter to add your extra config.
  389. //
  390. // Example:
  391. // // Create a OutputService4ProtocolTest client from just a session.
  392. // svc := outputservice4protocoltest.New(mySession)
  393. //
  394. // // Create a OutputService4ProtocolTest client with additional configuration
  395. // svc := outputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  396. func NewOutputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService4ProtocolTest {
  397. c := p.ClientConfig("outputservice4protocoltest", cfgs...)
  398. return newOutputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  399. }
  400. // newClient creates, initializes and returns a new service client instance.
  401. func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService4ProtocolTest {
  402. svc := &OutputService4ProtocolTest{
  403. Client: client.New(
  404. cfg,
  405. metadata.ClientInfo{
  406. ServiceName: "outputservice4protocoltest",
  407. SigningRegion: signingRegion,
  408. Endpoint: endpoint,
  409. APIVersion: "",
  410. },
  411. handlers,
  412. ),
  413. }
  414. // Handlers
  415. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  416. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  417. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  418. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  419. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  420. return svc
  421. }
  422. // newRequest creates a new request for a OutputService4ProtocolTest operation and runs any
  423. // custom request initialization.
  424. func (c *OutputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  425. req := c.NewRequest(op, params, data)
  426. return req
  427. }
  428. const opOutputService4TestCaseOperation1 = "OperationName"
  429. // OutputService4TestCaseOperation1Request generates a "aws/request.Request" representing the
  430. // client's request for the OutputService4TestCaseOperation1 operation. The "output" return
  431. // value can be used to capture response data after the request's "Send" method
  432. // is called.
  433. //
  434. // Creating a request object using this method should be used when you want to inject
  435. // custom logic into the request's lifecycle using a custom handler, or if you want to
  436. // access properties on the request object before or after sending the request. If
  437. // you just want the service response, call the OutputService4TestCaseOperation1 method directly
  438. // instead.
  439. //
  440. // Note: You must call the "Send" method on the returned request object in order
  441. // to execute the request.
  442. //
  443. // // Example sending a request using the OutputService4TestCaseOperation1Request method.
  444. // req, resp := client.OutputService4TestCaseOperation1Request(params)
  445. //
  446. // err := req.Send()
  447. // if err == nil { // resp is now filled
  448. // fmt.Println(resp)
  449. // }
  450. //
  451. func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation1Output) {
  452. op := &request.Operation{
  453. Name: opOutputService4TestCaseOperation1,
  454. HTTPPath: "/",
  455. }
  456. if input == nil {
  457. input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{}
  458. }
  459. req = c.newRequest(op, input, output)
  460. output = &OutputService4TestShapeOutputService4TestCaseOperation1Output{}
  461. req.Data = output
  462. return
  463. }
  464. func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) {
  465. req, out := c.OutputService4TestCaseOperation1Request(input)
  466. err := req.Send()
  467. return out, err
  468. }
  469. type OutputService4TestShapeOutputService4TestCaseOperation1Input struct {
  470. _ struct{} `type:"structure"`
  471. }
  472. type OutputService4TestShapeOutputService4TestCaseOperation1Output struct {
  473. _ struct{} `type:"structure"`
  474. ListMember []*string `locationNameList:"item" type:"list"`
  475. }
  476. //The service client's operations are safe to be used concurrently.
  477. // It is not safe to mutate any of the client's properties though.
  478. type OutputService5ProtocolTest struct {
  479. *client.Client
  480. }
  481. // New creates a new instance of the OutputService5ProtocolTest client with a session.
  482. // If additional configuration is needed for the client instance use the optional
  483. // aws.Config parameter to add your extra config.
  484. //
  485. // Example:
  486. // // Create a OutputService5ProtocolTest client from just a session.
  487. // svc := outputservice5protocoltest.New(mySession)
  488. //
  489. // // Create a OutputService5ProtocolTest client with additional configuration
  490. // svc := outputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  491. func NewOutputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService5ProtocolTest {
  492. c := p.ClientConfig("outputservice5protocoltest", cfgs...)
  493. return newOutputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  494. }
  495. // newClient creates, initializes and returns a new service client instance.
  496. func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService5ProtocolTest {
  497. svc := &OutputService5ProtocolTest{
  498. Client: client.New(
  499. cfg,
  500. metadata.ClientInfo{
  501. ServiceName: "outputservice5protocoltest",
  502. SigningRegion: signingRegion,
  503. Endpoint: endpoint,
  504. APIVersion: "",
  505. },
  506. handlers,
  507. ),
  508. }
  509. // Handlers
  510. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  511. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  512. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  513. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  514. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  515. return svc
  516. }
  517. // newRequest creates a new request for a OutputService5ProtocolTest operation and runs any
  518. // custom request initialization.
  519. func (c *OutputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  520. req := c.NewRequest(op, params, data)
  521. return req
  522. }
  523. const opOutputService5TestCaseOperation1 = "OperationName"
  524. // OutputService5TestCaseOperation1Request generates a "aws/request.Request" representing the
  525. // client's request for the OutputService5TestCaseOperation1 operation. The "output" return
  526. // value can be used to capture response data after the request's "Send" method
  527. // is called.
  528. //
  529. // Creating a request object using this method should be used when you want to inject
  530. // custom logic into the request's lifecycle using a custom handler, or if you want to
  531. // access properties on the request object before or after sending the request. If
  532. // you just want the service response, call the OutputService5TestCaseOperation1 method directly
  533. // instead.
  534. //
  535. // Note: You must call the "Send" method on the returned request object in order
  536. // to execute the request.
  537. //
  538. // // Example sending a request using the OutputService5TestCaseOperation1Request method.
  539. // req, resp := client.OutputService5TestCaseOperation1Request(params)
  540. //
  541. // err := req.Send()
  542. // if err == nil { // resp is now filled
  543. // fmt.Println(resp)
  544. // }
  545. //
  546. func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *request.Request, output *OutputService5TestShapeOutputService5TestCaseOperation1Output) {
  547. op := &request.Operation{
  548. Name: opOutputService5TestCaseOperation1,
  549. HTTPPath: "/",
  550. }
  551. if input == nil {
  552. input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{}
  553. }
  554. req = c.newRequest(op, input, output)
  555. output = &OutputService5TestShapeOutputService5TestCaseOperation1Output{}
  556. req.Data = output
  557. return
  558. }
  559. func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) {
  560. req, out := c.OutputService5TestCaseOperation1Request(input)
  561. err := req.Send()
  562. return out, err
  563. }
  564. type OutputService5TestShapeOutputService5TestCaseOperation1Input struct {
  565. _ struct{} `type:"structure"`
  566. }
  567. type OutputService5TestShapeOutputService5TestCaseOperation1Output struct {
  568. _ struct{} `type:"structure"`
  569. ListMember []*string `type:"list" flattened:"true"`
  570. }
  571. //The service client's operations are safe to be used concurrently.
  572. // It is not safe to mutate any of the client's properties though.
  573. type OutputService6ProtocolTest struct {
  574. *client.Client
  575. }
  576. // New creates a new instance of the OutputService6ProtocolTest client with a session.
  577. // If additional configuration is needed for the client instance use the optional
  578. // aws.Config parameter to add your extra config.
  579. //
  580. // Example:
  581. // // Create a OutputService6ProtocolTest client from just a session.
  582. // svc := outputservice6protocoltest.New(mySession)
  583. //
  584. // // Create a OutputService6ProtocolTest client with additional configuration
  585. // svc := outputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  586. func NewOutputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService6ProtocolTest {
  587. c := p.ClientConfig("outputservice6protocoltest", cfgs...)
  588. return newOutputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  589. }
  590. // newClient creates, initializes and returns a new service client instance.
  591. func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService6ProtocolTest {
  592. svc := &OutputService6ProtocolTest{
  593. Client: client.New(
  594. cfg,
  595. metadata.ClientInfo{
  596. ServiceName: "outputservice6protocoltest",
  597. SigningRegion: signingRegion,
  598. Endpoint: endpoint,
  599. APIVersion: "",
  600. },
  601. handlers,
  602. ),
  603. }
  604. // Handlers
  605. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  606. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  607. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  608. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  609. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  610. return svc
  611. }
  612. // newRequest creates a new request for a OutputService6ProtocolTest operation and runs any
  613. // custom request initialization.
  614. func (c *OutputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  615. req := c.NewRequest(op, params, data)
  616. return req
  617. }
  618. const opOutputService6TestCaseOperation1 = "OperationName"
  619. // OutputService6TestCaseOperation1Request generates a "aws/request.Request" representing the
  620. // client's request for the OutputService6TestCaseOperation1 operation. The "output" return
  621. // value can be used to capture response data after the request's "Send" method
  622. // is called.
  623. //
  624. // Creating a request object using this method should be used when you want to inject
  625. // custom logic into the request's lifecycle using a custom handler, or if you want to
  626. // access properties on the request object before or after sending the request. If
  627. // you just want the service response, call the OutputService6TestCaseOperation1 method directly
  628. // instead.
  629. //
  630. // Note: You must call the "Send" method on the returned request object in order
  631. // to execute the request.
  632. //
  633. // // Example sending a request using the OutputService6TestCaseOperation1Request method.
  634. // req, resp := client.OutputService6TestCaseOperation1Request(params)
  635. //
  636. // err := req.Send()
  637. // if err == nil { // resp is now filled
  638. // fmt.Println(resp)
  639. // }
  640. //
  641. func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *request.Request, output *OutputService6TestShapeOutputService6TestCaseOperation1Output) {
  642. op := &request.Operation{
  643. Name: opOutputService6TestCaseOperation1,
  644. HTTPPath: "/",
  645. }
  646. if input == nil {
  647. input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{}
  648. }
  649. req = c.newRequest(op, input, output)
  650. output = &OutputService6TestShapeOutputService6TestCaseOperation1Output{}
  651. req.Data = output
  652. return
  653. }
  654. func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) {
  655. req, out := c.OutputService6TestCaseOperation1Request(input)
  656. err := req.Send()
  657. return out, err
  658. }
  659. type OutputService6TestShapeOutputService6TestCaseOperation1Input struct {
  660. _ struct{} `type:"structure"`
  661. }
  662. type OutputService6TestShapeOutputService6TestCaseOperation1Output struct {
  663. _ struct{} `type:"structure"`
  664. Map map[string]*OutputService6TestShapeSingleStructure `type:"map"`
  665. }
  666. type OutputService6TestShapeSingleStructure struct {
  667. _ struct{} `type:"structure"`
  668. Foo *string `locationName:"foo" type:"string"`
  669. }
  670. //The service client's operations are safe to be used concurrently.
  671. // It is not safe to mutate any of the client's properties though.
  672. type OutputService7ProtocolTest struct {
  673. *client.Client
  674. }
  675. // New creates a new instance of the OutputService7ProtocolTest client with a session.
  676. // If additional configuration is needed for the client instance use the optional
  677. // aws.Config parameter to add your extra config.
  678. //
  679. // Example:
  680. // // Create a OutputService7ProtocolTest client from just a session.
  681. // svc := outputservice7protocoltest.New(mySession)
  682. //
  683. // // Create a OutputService7ProtocolTest client with additional configuration
  684. // svc := outputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  685. func NewOutputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService7ProtocolTest {
  686. c := p.ClientConfig("outputservice7protocoltest", cfgs...)
  687. return newOutputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  688. }
  689. // newClient creates, initializes and returns a new service client instance.
  690. func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService7ProtocolTest {
  691. svc := &OutputService7ProtocolTest{
  692. Client: client.New(
  693. cfg,
  694. metadata.ClientInfo{
  695. ServiceName: "outputservice7protocoltest",
  696. SigningRegion: signingRegion,
  697. Endpoint: endpoint,
  698. APIVersion: "",
  699. },
  700. handlers,
  701. ),
  702. }
  703. // Handlers
  704. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  705. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  706. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  707. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  708. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  709. return svc
  710. }
  711. // newRequest creates a new request for a OutputService7ProtocolTest operation and runs any
  712. // custom request initialization.
  713. func (c *OutputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  714. req := c.NewRequest(op, params, data)
  715. return req
  716. }
  717. const opOutputService7TestCaseOperation1 = "OperationName"
  718. // OutputService7TestCaseOperation1Request generates a "aws/request.Request" representing the
  719. // client's request for the OutputService7TestCaseOperation1 operation. The "output" return
  720. // value can be used to capture response data after the request's "Send" method
  721. // is called.
  722. //
  723. // Creating a request object using this method should be used when you want to inject
  724. // custom logic into the request's lifecycle using a custom handler, or if you want to
  725. // access properties on the request object before or after sending the request. If
  726. // you just want the service response, call the OutputService7TestCaseOperation1 method directly
  727. // instead.
  728. //
  729. // Note: You must call the "Send" method on the returned request object in order
  730. // to execute the request.
  731. //
  732. // // Example sending a request using the OutputService7TestCaseOperation1Request method.
  733. // req, resp := client.OutputService7TestCaseOperation1Request(params)
  734. //
  735. // err := req.Send()
  736. // if err == nil { // resp is now filled
  737. // fmt.Println(resp)
  738. // }
  739. //
  740. func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *request.Request, output *OutputService7TestShapeOutputService7TestCaseOperation1Output) {
  741. op := &request.Operation{
  742. Name: opOutputService7TestCaseOperation1,
  743. HTTPPath: "/",
  744. }
  745. if input == nil {
  746. input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{}
  747. }
  748. req = c.newRequest(op, input, output)
  749. output = &OutputService7TestShapeOutputService7TestCaseOperation1Output{}
  750. req.Data = output
  751. return
  752. }
  753. func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) {
  754. req, out := c.OutputService7TestCaseOperation1Request(input)
  755. err := req.Send()
  756. return out, err
  757. }
  758. type OutputService7TestShapeOutputService7TestCaseOperation1Input struct {
  759. _ struct{} `type:"structure"`
  760. }
  761. type OutputService7TestShapeOutputService7TestCaseOperation1Output struct {
  762. _ struct{} `type:"structure"`
  763. Map map[string]*string `type:"map" flattened:"true"`
  764. }
  765. //The service client's operations are safe to be used concurrently.
  766. // It is not safe to mutate any of the client's properties though.
  767. type OutputService8ProtocolTest struct {
  768. *client.Client
  769. }
  770. // New creates a new instance of the OutputService8ProtocolTest client with a session.
  771. // If additional configuration is needed for the client instance use the optional
  772. // aws.Config parameter to add your extra config.
  773. //
  774. // Example:
  775. // // Create a OutputService8ProtocolTest client from just a session.
  776. // svc := outputservice8protocoltest.New(mySession)
  777. //
  778. // // Create a OutputService8ProtocolTest client with additional configuration
  779. // svc := outputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  780. func NewOutputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService8ProtocolTest {
  781. c := p.ClientConfig("outputservice8protocoltest", cfgs...)
  782. return newOutputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  783. }
  784. // newClient creates, initializes and returns a new service client instance.
  785. func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService8ProtocolTest {
  786. svc := &OutputService8ProtocolTest{
  787. Client: client.New(
  788. cfg,
  789. metadata.ClientInfo{
  790. ServiceName: "outputservice8protocoltest",
  791. SigningRegion: signingRegion,
  792. Endpoint: endpoint,
  793. APIVersion: "",
  794. },
  795. handlers,
  796. ),
  797. }
  798. // Handlers
  799. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  800. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  801. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  802. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  803. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  804. return svc
  805. }
  806. // newRequest creates a new request for a OutputService8ProtocolTest operation and runs any
  807. // custom request initialization.
  808. func (c *OutputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  809. req := c.NewRequest(op, params, data)
  810. return req
  811. }
  812. const opOutputService8TestCaseOperation1 = "OperationName"
  813. // OutputService8TestCaseOperation1Request generates a "aws/request.Request" representing the
  814. // client's request for the OutputService8TestCaseOperation1 operation. The "output" return
  815. // value can be used to capture response data after the request's "Send" method
  816. // is called.
  817. //
  818. // Creating a request object using this method should be used when you want to inject
  819. // custom logic into the request's lifecycle using a custom handler, or if you want to
  820. // access properties on the request object before or after sending the request. If
  821. // you just want the service response, call the OutputService8TestCaseOperation1 method directly
  822. // instead.
  823. //
  824. // Note: You must call the "Send" method on the returned request object in order
  825. // to execute the request.
  826. //
  827. // // Example sending a request using the OutputService8TestCaseOperation1Request method.
  828. // req, resp := client.OutputService8TestCaseOperation1Request(params)
  829. //
  830. // err := req.Send()
  831. // if err == nil { // resp is now filled
  832. // fmt.Println(resp)
  833. // }
  834. //
  835. func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *request.Request, output *OutputService8TestShapeOutputService8TestCaseOperation1Output) {
  836. op := &request.Operation{
  837. Name: opOutputService8TestCaseOperation1,
  838. HTTPPath: "/",
  839. }
  840. if input == nil {
  841. input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{}
  842. }
  843. req = c.newRequest(op, input, output)
  844. output = &OutputService8TestShapeOutputService8TestCaseOperation1Output{}
  845. req.Data = output
  846. return
  847. }
  848. func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) {
  849. req, out := c.OutputService8TestCaseOperation1Request(input)
  850. err := req.Send()
  851. return out, err
  852. }
  853. type OutputService8TestShapeOutputService8TestCaseOperation1Input struct {
  854. _ struct{} `type:"structure"`
  855. }
  856. type OutputService8TestShapeOutputService8TestCaseOperation1Output struct {
  857. _ struct{} `type:"structure"`
  858. Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map"`
  859. }
  860. //The service client's operations are safe to be used concurrently.
  861. // It is not safe to mutate any of the client's properties though.
  862. type OutputService9ProtocolTest struct {
  863. *client.Client
  864. }
  865. // New creates a new instance of the OutputService9ProtocolTest client with a session.
  866. // If additional configuration is needed for the client instance use the optional
  867. // aws.Config parameter to add your extra config.
  868. //
  869. // Example:
  870. // // Create a OutputService9ProtocolTest client from just a session.
  871. // svc := outputservice9protocoltest.New(mySession)
  872. //
  873. // // Create a OutputService9ProtocolTest client with additional configuration
  874. // svc := outputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  875. func NewOutputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService9ProtocolTest {
  876. c := p.ClientConfig("outputservice9protocoltest", cfgs...)
  877. return newOutputService9ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  878. }
  879. // newClient creates, initializes and returns a new service client instance.
  880. func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService9ProtocolTest {
  881. svc := &OutputService9ProtocolTest{
  882. Client: client.New(
  883. cfg,
  884. metadata.ClientInfo{
  885. ServiceName: "outputservice9protocoltest",
  886. SigningRegion: signingRegion,
  887. Endpoint: endpoint,
  888. APIVersion: "",
  889. },
  890. handlers,
  891. ),
  892. }
  893. // Handlers
  894. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  895. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  896. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  897. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  898. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  899. return svc
  900. }
  901. // newRequest creates a new request for a OutputService9ProtocolTest operation and runs any
  902. // custom request initialization.
  903. func (c *OutputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  904. req := c.NewRequest(op, params, data)
  905. return req
  906. }
  907. const opOutputService9TestCaseOperation1 = "OperationName"
  908. // OutputService9TestCaseOperation1Request generates a "aws/request.Request" representing the
  909. // client's request for the OutputService9TestCaseOperation1 operation. The "output" return
  910. // value can be used to capture response data after the request's "Send" method
  911. // is called.
  912. //
  913. // Creating a request object using this method should be used when you want to inject
  914. // custom logic into the request's lifecycle using a custom handler, or if you want to
  915. // access properties on the request object before or after sending the request. If
  916. // you just want the service response, call the OutputService9TestCaseOperation1 method directly
  917. // instead.
  918. //
  919. // Note: You must call the "Send" method on the returned request object in order
  920. // to execute the request.
  921. //
  922. // // Example sending a request using the OutputService9TestCaseOperation1Request method.
  923. // req, resp := client.OutputService9TestCaseOperation1Request(params)
  924. //
  925. // err := req.Send()
  926. // if err == nil { // resp is now filled
  927. // fmt.Println(resp)
  928. // }
  929. //
  930. func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *request.Request, output *OutputService9TestShapeOutputService9TestCaseOperation1Output) {
  931. op := &request.Operation{
  932. Name: opOutputService9TestCaseOperation1,
  933. HTTPPath: "/",
  934. }
  935. if input == nil {
  936. input = &OutputService9TestShapeOutputService9TestCaseOperation1Input{}
  937. }
  938. req = c.newRequest(op, input, output)
  939. output = &OutputService9TestShapeOutputService9TestCaseOperation1Output{}
  940. req.Data = output
  941. return
  942. }
  943. func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) {
  944. req, out := c.OutputService9TestCaseOperation1Request(input)
  945. err := req.Send()
  946. return out, err
  947. }
  948. type OutputService9TestShapeOutputService9TestCaseOperation1Input struct {
  949. _ struct{} `type:"structure"`
  950. }
  951. type OutputService9TestShapeOutputService9TestCaseOperation1Output struct {
  952. _ struct{} `type:"structure" payload:"Data"`
  953. Data *OutputService9TestShapeSingleStructure `type:"structure"`
  954. Header *string `location:"header" locationName:"X-Foo" type:"string"`
  955. }
  956. type OutputService9TestShapeSingleStructure struct {
  957. _ struct{} `type:"structure"`
  958. Foo *string `type:"string"`
  959. }
  960. //The service client's operations are safe to be used concurrently.
  961. // It is not safe to mutate any of the client's properties though.
  962. type OutputService10ProtocolTest struct {
  963. *client.Client
  964. }
  965. // New creates a new instance of the OutputService10ProtocolTest client with a session.
  966. // If additional configuration is needed for the client instance use the optional
  967. // aws.Config parameter to add your extra config.
  968. //
  969. // Example:
  970. // // Create a OutputService10ProtocolTest client from just a session.
  971. // svc := outputservice10protocoltest.New(mySession)
  972. //
  973. // // Create a OutputService10ProtocolTest client with additional configuration
  974. // svc := outputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  975. func NewOutputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService10ProtocolTest {
  976. c := p.ClientConfig("outputservice10protocoltest", cfgs...)
  977. return newOutputService10ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  978. }
  979. // newClient creates, initializes and returns a new service client instance.
  980. func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService10ProtocolTest {
  981. svc := &OutputService10ProtocolTest{
  982. Client: client.New(
  983. cfg,
  984. metadata.ClientInfo{
  985. ServiceName: "outputservice10protocoltest",
  986. SigningRegion: signingRegion,
  987. Endpoint: endpoint,
  988. APIVersion: "",
  989. },
  990. handlers,
  991. ),
  992. }
  993. // Handlers
  994. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  995. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  996. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  997. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  998. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  999. return svc
  1000. }
  1001. // newRequest creates a new request for a OutputService10ProtocolTest operation and runs any
  1002. // custom request initialization.
  1003. func (c *OutputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  1004. req := c.NewRequest(op, params, data)
  1005. return req
  1006. }
  1007. const opOutputService10TestCaseOperation1 = "OperationName"
  1008. // OutputService10TestCaseOperation1Request generates a "aws/request.Request" representing the
  1009. // client's request for the OutputService10TestCaseOperation1 operation. The "output" return
  1010. // value can be used to capture response data after the request's "Send" method
  1011. // is called.
  1012. //
  1013. // Creating a request object using this method should be used when you want to inject
  1014. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1015. // access properties on the request object before or after sending the request. If
  1016. // you just want the service response, call the OutputService10TestCaseOperation1 method directly
  1017. // instead.
  1018. //
  1019. // Note: You must call the "Send" method on the returned request object in order
  1020. // to execute the request.
  1021. //
  1022. // // Example sending a request using the OutputService10TestCaseOperation1Request method.
  1023. // req, resp := client.OutputService10TestCaseOperation1Request(params)
  1024. //
  1025. // err := req.Send()
  1026. // if err == nil { // resp is now filled
  1027. // fmt.Println(resp)
  1028. // }
  1029. //
  1030. func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (req *request.Request, output *OutputService10TestShapeOutputService10TestCaseOperation1Output) {
  1031. op := &request.Operation{
  1032. Name: opOutputService10TestCaseOperation1,
  1033. HTTPPath: "/",
  1034. }
  1035. if input == nil {
  1036. input = &OutputService10TestShapeOutputService10TestCaseOperation1Input{}
  1037. }
  1038. req = c.newRequest(op, input, output)
  1039. output = &OutputService10TestShapeOutputService10TestCaseOperation1Output{}
  1040. req.Data = output
  1041. return
  1042. }
  1043. func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) {
  1044. req, out := c.OutputService10TestCaseOperation1Request(input)
  1045. err := req.Send()
  1046. return out, err
  1047. }
  1048. type OutputService10TestShapeOutputService10TestCaseOperation1Input struct {
  1049. _ struct{} `type:"structure"`
  1050. }
  1051. type OutputService10TestShapeOutputService10TestCaseOperation1Output struct {
  1052. _ struct{} `type:"structure" payload:"Stream"`
  1053. Stream []byte `type:"blob"`
  1054. }
  1055. //The service client's operations are safe to be used concurrently.
  1056. // It is not safe to mutate any of the client's properties though.
  1057. type OutputService11ProtocolTest struct {
  1058. *client.Client
  1059. }
  1060. // New creates a new instance of the OutputService11ProtocolTest client with a session.
  1061. // If additional configuration is needed for the client instance use the optional
  1062. // aws.Config parameter to add your extra config.
  1063. //
  1064. // Example:
  1065. // // Create a OutputService11ProtocolTest client from just a session.
  1066. // svc := outputservice11protocoltest.New(mySession)
  1067. //
  1068. // // Create a OutputService11ProtocolTest client with additional configuration
  1069. // svc := outputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  1070. func NewOutputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService11ProtocolTest {
  1071. c := p.ClientConfig("outputservice11protocoltest", cfgs...)
  1072. return newOutputService11ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  1073. }
  1074. // newClient creates, initializes and returns a new service client instance.
  1075. func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService11ProtocolTest {
  1076. svc := &OutputService11ProtocolTest{
  1077. Client: client.New(
  1078. cfg,
  1079. metadata.ClientInfo{
  1080. ServiceName: "outputservice11protocoltest",
  1081. SigningRegion: signingRegion,
  1082. Endpoint: endpoint,
  1083. APIVersion: "",
  1084. },
  1085. handlers,
  1086. ),
  1087. }
  1088. // Handlers
  1089. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  1090. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  1091. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  1092. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  1093. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  1094. return svc
  1095. }
  1096. // newRequest creates a new request for a OutputService11ProtocolTest operation and runs any
  1097. // custom request initialization.
  1098. func (c *OutputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  1099. req := c.NewRequest(op, params, data)
  1100. return req
  1101. }
  1102. const opOutputService11TestCaseOperation1 = "OperationName"
  1103. // OutputService11TestCaseOperation1Request generates a "aws/request.Request" representing the
  1104. // client's request for the OutputService11TestCaseOperation1 operation. The "output" return
  1105. // value can be used to capture response data after the request's "Send" method
  1106. // is called.
  1107. //
  1108. // Creating a request object using this method should be used when you want to inject
  1109. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1110. // access properties on the request object before or after sending the request. If
  1111. // you just want the service response, call the OutputService11TestCaseOperation1 method directly
  1112. // instead.
  1113. //
  1114. // Note: You must call the "Send" method on the returned request object in order
  1115. // to execute the request.
  1116. //
  1117. // // Example sending a request using the OutputService11TestCaseOperation1Request method.
  1118. // req, resp := client.OutputService11TestCaseOperation1Request(params)
  1119. //
  1120. // err := req.Send()
  1121. // if err == nil { // resp is now filled
  1122. // fmt.Println(resp)
  1123. // }
  1124. //
  1125. func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (req *request.Request, output *OutputService11TestShapeOutputService11TestCaseOperation1Output) {
  1126. op := &request.Operation{
  1127. Name: opOutputService11TestCaseOperation1,
  1128. HTTPPath: "/",
  1129. }
  1130. if input == nil {
  1131. input = &OutputService11TestShapeOutputService11TestCaseOperation1Input{}
  1132. }
  1133. req = c.newRequest(op, input, output)
  1134. output = &OutputService11TestShapeOutputService11TestCaseOperation1Output{}
  1135. req.Data = output
  1136. return
  1137. }
  1138. func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) {
  1139. req, out := c.OutputService11TestCaseOperation1Request(input)
  1140. err := req.Send()
  1141. return out, err
  1142. }
  1143. type OutputService11TestShapeOutputService11TestCaseOperation1Input struct {
  1144. _ struct{} `type:"structure"`
  1145. }
  1146. type OutputService11TestShapeOutputService11TestCaseOperation1Output struct {
  1147. _ struct{} `type:"structure"`
  1148. Char *string `location:"header" locationName:"x-char" type:"character"`
  1149. Double *float64 `location:"header" locationName:"x-double" type:"double"`
  1150. FalseBool *bool `location:"header" locationName:"x-false-bool" type:"boolean"`
  1151. Float *float64 `location:"header" locationName:"x-float" type:"float"`
  1152. Integer *int64 `location:"header" locationName:"x-int" type:"integer"`
  1153. Long *int64 `location:"header" locationName:"x-long" type:"long"`
  1154. Str *string `location:"header" locationName:"x-str" type:"string"`
  1155. Timestamp *time.Time `location:"header" locationName:"x-timestamp" type:"timestamp" timestampFormat:"iso8601"`
  1156. TrueBool *bool `location:"header" locationName:"x-true-bool" type:"boolean"`
  1157. }
  1158. //The service client's operations are safe to be used concurrently.
  1159. // It is not safe to mutate any of the client's properties though.
  1160. type OutputService12ProtocolTest struct {
  1161. *client.Client
  1162. }
  1163. // New creates a new instance of the OutputService12ProtocolTest client with a session.
  1164. // If additional configuration is needed for the client instance use the optional
  1165. // aws.Config parameter to add your extra config.
  1166. //
  1167. // Example:
  1168. // // Create a OutputService12ProtocolTest client from just a session.
  1169. // svc := outputservice12protocoltest.New(mySession)
  1170. //
  1171. // // Create a OutputService12ProtocolTest client with additional configuration
  1172. // svc := outputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  1173. func NewOutputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService12ProtocolTest {
  1174. c := p.ClientConfig("outputservice12protocoltest", cfgs...)
  1175. return newOutputService12ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  1176. }
  1177. // newClient creates, initializes and returns a new service client instance.
  1178. func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService12ProtocolTest {
  1179. svc := &OutputService12ProtocolTest{
  1180. Client: client.New(
  1181. cfg,
  1182. metadata.ClientInfo{
  1183. ServiceName: "outputservice12protocoltest",
  1184. SigningRegion: signingRegion,
  1185. Endpoint: endpoint,
  1186. APIVersion: "",
  1187. },
  1188. handlers,
  1189. ),
  1190. }
  1191. // Handlers
  1192. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  1193. svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
  1194. svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
  1195. svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
  1196. svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
  1197. return svc
  1198. }
  1199. // newRequest creates a new request for a OutputService12ProtocolTest operation and runs any
  1200. // custom request initialization.
  1201. func (c *OutputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  1202. req := c.NewRequest(op, params, data)
  1203. return req
  1204. }
  1205. const opOutputService12TestCaseOperation1 = "OperationName"
  1206. // OutputService12TestCaseOperation1Request generates a "aws/request.Request" representing the
  1207. // client's request for the OutputService12TestCaseOperation1 operation. The "output" return
  1208. // value can be used to capture response data after the request's "Send" method
  1209. // is called.
  1210. //
  1211. // Creating a request object using this method should be used when you want to inject
  1212. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1213. // access properties on the request object before or after sending the request. If
  1214. // you just want the service response, call the OutputService12TestCaseOperation1 method directly
  1215. // instead.
  1216. //
  1217. // Note: You must call the "Send" method on the returned request object in order
  1218. // to execute the request.
  1219. //
  1220. // // Example sending a request using the OutputService12TestCaseOperation1Request method.
  1221. // req, resp := client.OutputService12TestCaseOperation1Request(params)
  1222. //
  1223. // err := req.Send()
  1224. // if err == nil { // resp is now filled
  1225. // fmt.Println(resp)
  1226. // }
  1227. //
  1228. func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (req *request.Request, output *OutputService12TestShapeOutputService12TestCaseOperation1Output) {
  1229. op := &request.Operation{
  1230. Name: opOutputService12TestCaseOperation1,
  1231. HTTPPath: "/",
  1232. }
  1233. if input == nil {
  1234. input = &OutputService12TestShapeOutputService12TestCaseOperation1Input{}
  1235. }
  1236. req = c.newRequest(op, input, output)
  1237. output = &OutputService12TestShapeOutputService12TestCaseOperation1Output{}
  1238. req.Data = output
  1239. return
  1240. }
  1241. func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (*OutputService12TestShapeOutputService12TestCaseOperation1Output, error) {
  1242. req, out := c.OutputService12TestCaseOperation1Request(input)
  1243. err := req.Send()
  1244. return out, err
  1245. }
  1246. type OutputService12TestShapeOutputService12TestCaseOperation1Input struct {
  1247. _ struct{} `type:"structure"`
  1248. }
  1249. type OutputService12TestShapeOutputService12TestCaseOperation1Output struct {
  1250. _ struct{} `type:"structure"`
  1251. Foo *string `type:"string"`
  1252. }
  1253. //
  1254. // Tests begin here
  1255. //
  1256. func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
  1257. svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1258. buf := bytes.NewReader([]byte("<OperationNameResponse><Str>myname</Str><FooNum>123</FooNum><FalseBool>false</FalseBool><TrueBool>true</TrueBool><Float>1.2</Float><Double>1.3</Double><Long>200</Long><Char>a</Char><Timestamp>2015-01-25T08:00:00Z</Timestamp></OperationNameResponse>"))
  1259. req, out := svc.OutputService1TestCaseOperation1Request(nil)
  1260. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1261. // set headers
  1262. req.HTTPResponse.Header.Set("ImaHeader", "test")
  1263. req.HTTPResponse.Header.Set("X-Foo", "abc")
  1264. // unmarshal response
  1265. restxml.UnmarshalMeta(req)
  1266. restxml.Unmarshal(req)
  1267. assert.NoError(t, req.Error)
  1268. // assert response
  1269. assert.NotNil(t, out) // ensure out variable is used
  1270. assert.Equal(t, "a", *out.Char)
  1271. assert.Equal(t, 1.3, *out.Double)
  1272. assert.Equal(t, false, *out.FalseBool)
  1273. assert.Equal(t, 1.2, *out.Float)
  1274. assert.Equal(t, "test", *out.ImaHeader)
  1275. assert.Equal(t, "abc", *out.ImaHeaderLocation)
  1276. assert.Equal(t, int64(200), *out.Long)
  1277. assert.Equal(t, int64(123), *out.Num)
  1278. assert.Equal(t, "myname", *out.Str)
  1279. assert.Equal(t, time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String())
  1280. assert.Equal(t, true, *out.TrueBool)
  1281. }
  1282. func TestOutputService1ProtocolTestScalarMembersCase2(t *testing.T) {
  1283. svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1284. buf := bytes.NewReader([]byte("<OperationNameResponse><Str></Str><FooNum>123</FooNum><FalseBool>false</FalseBool><TrueBool>true</TrueBool><Float>1.2</Float><Double>1.3</Double><Long>200</Long><Char>a</Char><Timestamp>2015-01-25T08:00:00Z</Timestamp></OperationNameResponse>"))
  1285. req, out := svc.OutputService1TestCaseOperation2Request(nil)
  1286. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1287. // set headers
  1288. req.HTTPResponse.Header.Set("ImaHeader", "test")
  1289. req.HTTPResponse.Header.Set("X-Foo", "abc")
  1290. // unmarshal response
  1291. restxml.UnmarshalMeta(req)
  1292. restxml.Unmarshal(req)
  1293. assert.NoError(t, req.Error)
  1294. // assert response
  1295. assert.NotNil(t, out) // ensure out variable is used
  1296. assert.Equal(t, "a", *out.Char)
  1297. assert.Equal(t, 1.3, *out.Double)
  1298. assert.Equal(t, false, *out.FalseBool)
  1299. assert.Equal(t, 1.2, *out.Float)
  1300. assert.Equal(t, "test", *out.ImaHeader)
  1301. assert.Equal(t, "abc", *out.ImaHeaderLocation)
  1302. assert.Equal(t, int64(200), *out.Long)
  1303. assert.Equal(t, int64(123), *out.Num)
  1304. assert.Equal(t, "", *out.Str)
  1305. assert.Equal(t, time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String())
  1306. assert.Equal(t, true, *out.TrueBool)
  1307. }
  1308. func TestOutputService2ProtocolTestBlobCase1(t *testing.T) {
  1309. svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1310. buf := bytes.NewReader([]byte("<OperationNameResult><Blob>dmFsdWU=</Blob></OperationNameResult>"))
  1311. req, out := svc.OutputService2TestCaseOperation1Request(nil)
  1312. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1313. // set headers
  1314. // unmarshal response
  1315. restxml.UnmarshalMeta(req)
  1316. restxml.Unmarshal(req)
  1317. assert.NoError(t, req.Error)
  1318. // assert response
  1319. assert.NotNil(t, out) // ensure out variable is used
  1320. assert.Equal(t, "value", string(out.Blob))
  1321. }
  1322. func TestOutputService3ProtocolTestListsCase1(t *testing.T) {
  1323. svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1324. buf := bytes.NewReader([]byte("<OperationNameResult><ListMember><member>abc</member><member>123</member></ListMember></OperationNameResult>"))
  1325. req, out := svc.OutputService3TestCaseOperation1Request(nil)
  1326. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1327. // set headers
  1328. // unmarshal response
  1329. restxml.UnmarshalMeta(req)
  1330. restxml.Unmarshal(req)
  1331. assert.NoError(t, req.Error)
  1332. // assert response
  1333. assert.NotNil(t, out) // ensure out variable is used
  1334. assert.Equal(t, "abc", *out.ListMember[0])
  1335. assert.Equal(t, "123", *out.ListMember[1])
  1336. }
  1337. func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
  1338. svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1339. buf := bytes.NewReader([]byte("<OperationNameResult><ListMember><item>abc</item><item>123</item></ListMember></OperationNameResult>"))
  1340. req, out := svc.OutputService4TestCaseOperation1Request(nil)
  1341. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1342. // set headers
  1343. // unmarshal response
  1344. restxml.UnmarshalMeta(req)
  1345. restxml.Unmarshal(req)
  1346. assert.NoError(t, req.Error)
  1347. // assert response
  1348. assert.NotNil(t, out) // ensure out variable is used
  1349. assert.Equal(t, "abc", *out.ListMember[0])
  1350. assert.Equal(t, "123", *out.ListMember[1])
  1351. }
  1352. func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) {
  1353. svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1354. buf := bytes.NewReader([]byte("<OperationNameResult><ListMember>abc</ListMember><ListMember>123</ListMember></OperationNameResult>"))
  1355. req, out := svc.OutputService5TestCaseOperation1Request(nil)
  1356. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1357. // set headers
  1358. // unmarshal response
  1359. restxml.UnmarshalMeta(req)
  1360. restxml.Unmarshal(req)
  1361. assert.NoError(t, req.Error)
  1362. // assert response
  1363. assert.NotNil(t, out) // ensure out variable is used
  1364. assert.Equal(t, "abc", *out.ListMember[0])
  1365. assert.Equal(t, "123", *out.ListMember[1])
  1366. }
  1367. func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) {
  1368. svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1369. buf := bytes.NewReader([]byte("<OperationNameResult><Map><entry><key>qux</key><value><foo>bar</foo></value></entry><entry><key>baz</key><value><foo>bam</foo></value></entry></Map></OperationNameResult>"))
  1370. req, out := svc.OutputService6TestCaseOperation1Request(nil)
  1371. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1372. // set headers
  1373. // unmarshal response
  1374. restxml.UnmarshalMeta(req)
  1375. restxml.Unmarshal(req)
  1376. assert.NoError(t, req.Error)
  1377. // assert response
  1378. assert.NotNil(t, out) // ensure out variable is used
  1379. assert.Equal(t, "bam", *out.Map["baz"].Foo)
  1380. assert.Equal(t, "bar", *out.Map["qux"].Foo)
  1381. }
  1382. func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) {
  1383. svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1384. buf := bytes.NewReader([]byte("<OperationNameResult><Map><key>qux</key><value>bar</value></Map><Map><key>baz</key><value>bam</value></Map></OperationNameResult>"))
  1385. req, out := svc.OutputService7TestCaseOperation1Request(nil)
  1386. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1387. // set headers
  1388. // unmarshal response
  1389. restxml.UnmarshalMeta(req)
  1390. restxml.Unmarshal(req)
  1391. assert.NoError(t, req.Error)
  1392. // assert response
  1393. assert.NotNil(t, out) // ensure out variable is used
  1394. assert.Equal(t, "bam", *out.Map["baz"])
  1395. assert.Equal(t, "bar", *out.Map["qux"])
  1396. }
  1397. func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) {
  1398. svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1399. buf := bytes.NewReader([]byte("<OperationNameResult><Map><entry><foo>qux</foo><bar>bar</bar></entry><entry><foo>baz</foo><bar>bam</bar></entry></Map></OperationNameResult>"))
  1400. req, out := svc.OutputService8TestCaseOperation1Request(nil)
  1401. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1402. // set headers
  1403. // unmarshal response
  1404. restxml.UnmarshalMeta(req)
  1405. restxml.Unmarshal(req)
  1406. assert.NoError(t, req.Error)
  1407. // assert response
  1408. assert.NotNil(t, out) // ensure out variable is used
  1409. assert.Equal(t, "bam", *out.Map["baz"])
  1410. assert.Equal(t, "bar", *out.Map["qux"])
  1411. }
  1412. func TestOutputService9ProtocolTestXMLPayloadCase1(t *testing.T) {
  1413. svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1414. buf := bytes.NewReader([]byte("<OperationNameResponse><Foo>abc</Foo></OperationNameResponse>"))
  1415. req, out := svc.OutputService9TestCaseOperation1Request(nil)
  1416. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1417. // set headers
  1418. req.HTTPResponse.Header.Set("X-Foo", "baz")
  1419. // unmarshal response
  1420. restxml.UnmarshalMeta(req)
  1421. restxml.Unmarshal(req)
  1422. assert.NoError(t, req.Error)
  1423. // assert response
  1424. assert.NotNil(t, out) // ensure out variable is used
  1425. assert.Equal(t, "abc", *out.Data.Foo)
  1426. assert.Equal(t, "baz", *out.Header)
  1427. }
  1428. func TestOutputService10ProtocolTestStreamingPayloadCase1(t *testing.T) {
  1429. svc := NewOutputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1430. buf := bytes.NewReader([]byte("abc"))
  1431. req, out := svc.OutputService10TestCaseOperation1Request(nil)
  1432. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1433. // set headers
  1434. // unmarshal response
  1435. restxml.UnmarshalMeta(req)
  1436. restxml.Unmarshal(req)
  1437. assert.NoError(t, req.Error)
  1438. // assert response
  1439. assert.NotNil(t, out) // ensure out variable is used
  1440. assert.Equal(t, "abc", string(out.Stream))
  1441. }
  1442. func TestOutputService11ProtocolTestScalarMembersInHeadersCase1(t *testing.T) {
  1443. svc := NewOutputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1444. buf := bytes.NewReader([]byte(""))
  1445. req, out := svc.OutputService11TestCaseOperation1Request(nil)
  1446. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1447. // set headers
  1448. req.HTTPResponse.Header.Set("x-char", "a")
  1449. req.HTTPResponse.Header.Set("x-double", "1.5")
  1450. req.HTTPResponse.Header.Set("x-false-bool", "false")
  1451. req.HTTPResponse.Header.Set("x-float", "1.5")
  1452. req.HTTPResponse.Header.Set("x-int", "1")
  1453. req.HTTPResponse.Header.Set("x-long", "100")
  1454. req.HTTPResponse.Header.Set("x-str", "string")
  1455. req.HTTPResponse.Header.Set("x-timestamp", "Sun, 25 Jan 2015 08:00:00 GMT")
  1456. req.HTTPResponse.Header.Set("x-true-bool", "true")
  1457. // unmarshal response
  1458. restxml.UnmarshalMeta(req)
  1459. restxml.Unmarshal(req)
  1460. assert.NoError(t, req.Error)
  1461. // assert response
  1462. assert.NotNil(t, out) // ensure out variable is used
  1463. assert.Equal(t, "a", *out.Char)
  1464. assert.Equal(t, 1.5, *out.Double)
  1465. assert.Equal(t, false, *out.FalseBool)
  1466. assert.Equal(t, 1.5, *out.Float)
  1467. assert.Equal(t, int64(1), *out.Integer)
  1468. assert.Equal(t, int64(100), *out.Long)
  1469. assert.Equal(t, "string", *out.Str)
  1470. assert.Equal(t, time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String())
  1471. assert.Equal(t, true, *out.TrueBool)
  1472. }
  1473. func TestOutputService12ProtocolTestEmptyStringCase1(t *testing.T) {
  1474. svc := NewOutputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1475. buf := bytes.NewReader([]byte("<OperationNameResponse><Foo/><RequestId>requestid</RequestId></OperationNameResponse>"))
  1476. req, out := svc.OutputService12TestCaseOperation1Request(nil)
  1477. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1478. // set headers
  1479. // unmarshal response
  1480. restxml.UnmarshalMeta(req)
  1481. restxml.Unmarshal(req)
  1482. assert.NoError(t, req.Error)
  1483. // assert response
  1484. assert.NotNil(t, out) // ensure out variable is used
  1485. assert.Equal(t, "", *out.Foo)
  1486. }