unmarshal_test.go 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252
  1. package ec2query_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/ec2query"
  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(ec2query.BuildHandler)
  77. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  78. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  79. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 *OutputService1TestShapeOutputService1TestCaseOperation1Output) {
  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 = &OutputService1TestShapeOutputService1TestCaseOperation1Output{}
  121. req.Data = output
  122. return
  123. }
  124. func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) {
  125. req, out := c.OutputService1TestCaseOperation1Request(input)
  126. err := req.Send()
  127. return out, err
  128. }
  129. type OutputService1TestShapeOutputService1TestCaseOperation1Input struct {
  130. _ struct{} `type:"structure"`
  131. }
  132. type OutputService1TestShapeOutputService1TestCaseOperation1Output struct {
  133. _ struct{} `type:"structure"`
  134. Char *string `type:"character"`
  135. Double *float64 `type:"double"`
  136. FalseBool *bool `type:"boolean"`
  137. Float *float64 `type:"float"`
  138. Long *int64 `type:"long"`
  139. Num *int64 `locationName:"FooNum" type:"integer"`
  140. Str *string `type:"string"`
  141. TrueBool *bool `type:"boolean"`
  142. }
  143. //The service client's operations are safe to be used concurrently.
  144. // It is not safe to mutate any of the client's properties though.
  145. type OutputService2ProtocolTest struct {
  146. *client.Client
  147. }
  148. // New creates a new instance of the OutputService2ProtocolTest client with a session.
  149. // If additional configuration is needed for the client instance use the optional
  150. // aws.Config parameter to add your extra config.
  151. //
  152. // Example:
  153. // // Create a OutputService2ProtocolTest client from just a session.
  154. // svc := outputservice2protocoltest.New(mySession)
  155. //
  156. // // Create a OutputService2ProtocolTest client with additional configuration
  157. // svc := outputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  158. func NewOutputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService2ProtocolTest {
  159. c := p.ClientConfig("outputservice2protocoltest", cfgs...)
  160. return newOutputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  161. }
  162. // newClient creates, initializes and returns a new service client instance.
  163. func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService2ProtocolTest {
  164. svc := &OutputService2ProtocolTest{
  165. Client: client.New(
  166. cfg,
  167. metadata.ClientInfo{
  168. ServiceName: "outputservice2protocoltest",
  169. SigningRegion: signingRegion,
  170. Endpoint: endpoint,
  171. APIVersion: "",
  172. },
  173. handlers,
  174. ),
  175. }
  176. // Handlers
  177. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  178. svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
  179. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  180. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  181. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
  182. return svc
  183. }
  184. // newRequest creates a new request for a OutputService2ProtocolTest operation and runs any
  185. // custom request initialization.
  186. func (c *OutputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  187. req := c.NewRequest(op, params, data)
  188. return req
  189. }
  190. const opOutputService2TestCaseOperation1 = "OperationName"
  191. // OutputService2TestCaseOperation1Request generates a "aws/request.Request" representing the
  192. // client's request for the OutputService2TestCaseOperation1 operation. The "output" return
  193. // value can be used to capture response data after the request's "Send" method
  194. // is called.
  195. //
  196. // Creating a request object using this method should be used when you want to inject
  197. // custom logic into the request's lifecycle using a custom handler, or if you want to
  198. // access properties on the request object before or after sending the request. If
  199. // you just want the service response, call the OutputService2TestCaseOperation1 method directly
  200. // instead.
  201. //
  202. // Note: You must call the "Send" method on the returned request object in order
  203. // to execute the request.
  204. //
  205. // // Example sending a request using the OutputService2TestCaseOperation1Request method.
  206. // req, resp := client.OutputService2TestCaseOperation1Request(params)
  207. //
  208. // err := req.Send()
  209. // if err == nil { // resp is now filled
  210. // fmt.Println(resp)
  211. // }
  212. //
  213. func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *request.Request, output *OutputService2TestShapeOutputService2TestCaseOperation1Output) {
  214. op := &request.Operation{
  215. Name: opOutputService2TestCaseOperation1,
  216. HTTPPath: "/",
  217. }
  218. if input == nil {
  219. input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{}
  220. }
  221. req = c.newRequest(op, input, output)
  222. output = &OutputService2TestShapeOutputService2TestCaseOperation1Output{}
  223. req.Data = output
  224. return
  225. }
  226. func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) {
  227. req, out := c.OutputService2TestCaseOperation1Request(input)
  228. err := req.Send()
  229. return out, err
  230. }
  231. type OutputService2TestShapeOutputService2TestCaseOperation1Input struct {
  232. _ struct{} `type:"structure"`
  233. }
  234. type OutputService2TestShapeOutputService2TestCaseOperation1Output struct {
  235. _ struct{} `type:"structure"`
  236. // Blob is automatically base64 encoded/decoded by the SDK.
  237. Blob []byte `type:"blob"`
  238. }
  239. //The service client's operations are safe to be used concurrently.
  240. // It is not safe to mutate any of the client's properties though.
  241. type OutputService3ProtocolTest struct {
  242. *client.Client
  243. }
  244. // New creates a new instance of the OutputService3ProtocolTest client with a session.
  245. // If additional configuration is needed for the client instance use the optional
  246. // aws.Config parameter to add your extra config.
  247. //
  248. // Example:
  249. // // Create a OutputService3ProtocolTest client from just a session.
  250. // svc := outputservice3protocoltest.New(mySession)
  251. //
  252. // // Create a OutputService3ProtocolTest client with additional configuration
  253. // svc := outputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  254. func NewOutputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService3ProtocolTest {
  255. c := p.ClientConfig("outputservice3protocoltest", cfgs...)
  256. return newOutputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  257. }
  258. // newClient creates, initializes and returns a new service client instance.
  259. func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService3ProtocolTest {
  260. svc := &OutputService3ProtocolTest{
  261. Client: client.New(
  262. cfg,
  263. metadata.ClientInfo{
  264. ServiceName: "outputservice3protocoltest",
  265. SigningRegion: signingRegion,
  266. Endpoint: endpoint,
  267. APIVersion: "",
  268. },
  269. handlers,
  270. ),
  271. }
  272. // Handlers
  273. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  274. svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
  275. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  276. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  277. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
  278. return svc
  279. }
  280. // newRequest creates a new request for a OutputService3ProtocolTest operation and runs any
  281. // custom request initialization.
  282. func (c *OutputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  283. req := c.NewRequest(op, params, data)
  284. return req
  285. }
  286. const opOutputService3TestCaseOperation1 = "OperationName"
  287. // OutputService3TestCaseOperation1Request generates a "aws/request.Request" representing the
  288. // client's request for the OutputService3TestCaseOperation1 operation. The "output" return
  289. // value can be used to capture response data after the request's "Send" method
  290. // is called.
  291. //
  292. // Creating a request object using this method should be used when you want to inject
  293. // custom logic into the request's lifecycle using a custom handler, or if you want to
  294. // access properties on the request object before or after sending the request. If
  295. // you just want the service response, call the OutputService3TestCaseOperation1 method directly
  296. // instead.
  297. //
  298. // Note: You must call the "Send" method on the returned request object in order
  299. // to execute the request.
  300. //
  301. // // Example sending a request using the OutputService3TestCaseOperation1Request method.
  302. // req, resp := client.OutputService3TestCaseOperation1Request(params)
  303. //
  304. // err := req.Send()
  305. // if err == nil { // resp is now filled
  306. // fmt.Println(resp)
  307. // }
  308. //
  309. func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *request.Request, output *OutputService3TestShapeOutputService3TestCaseOperation1Output) {
  310. op := &request.Operation{
  311. Name: opOutputService3TestCaseOperation1,
  312. HTTPPath: "/",
  313. }
  314. if input == nil {
  315. input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{}
  316. }
  317. req = c.newRequest(op, input, output)
  318. output = &OutputService3TestShapeOutputService3TestCaseOperation1Output{}
  319. req.Data = output
  320. return
  321. }
  322. func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) {
  323. req, out := c.OutputService3TestCaseOperation1Request(input)
  324. err := req.Send()
  325. return out, err
  326. }
  327. type OutputService3TestShapeOutputService3TestCaseOperation1Input struct {
  328. _ struct{} `type:"structure"`
  329. }
  330. type OutputService3TestShapeOutputService3TestCaseOperation1Output struct {
  331. _ struct{} `type:"structure"`
  332. ListMember []*string `type:"list"`
  333. }
  334. //The service client's operations are safe to be used concurrently.
  335. // It is not safe to mutate any of the client's properties though.
  336. type OutputService4ProtocolTest struct {
  337. *client.Client
  338. }
  339. // New creates a new instance of the OutputService4ProtocolTest client with a session.
  340. // If additional configuration is needed for the client instance use the optional
  341. // aws.Config parameter to add your extra config.
  342. //
  343. // Example:
  344. // // Create a OutputService4ProtocolTest client from just a session.
  345. // svc := outputservice4protocoltest.New(mySession)
  346. //
  347. // // Create a OutputService4ProtocolTest client with additional configuration
  348. // svc := outputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  349. func NewOutputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService4ProtocolTest {
  350. c := p.ClientConfig("outputservice4protocoltest", cfgs...)
  351. return newOutputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  352. }
  353. // newClient creates, initializes and returns a new service client instance.
  354. func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService4ProtocolTest {
  355. svc := &OutputService4ProtocolTest{
  356. Client: client.New(
  357. cfg,
  358. metadata.ClientInfo{
  359. ServiceName: "outputservice4protocoltest",
  360. SigningRegion: signingRegion,
  361. Endpoint: endpoint,
  362. APIVersion: "",
  363. },
  364. handlers,
  365. ),
  366. }
  367. // Handlers
  368. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  369. svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
  370. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  371. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  372. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
  373. return svc
  374. }
  375. // newRequest creates a new request for a OutputService4ProtocolTest operation and runs any
  376. // custom request initialization.
  377. func (c *OutputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  378. req := c.NewRequest(op, params, data)
  379. return req
  380. }
  381. const opOutputService4TestCaseOperation1 = "OperationName"
  382. // OutputService4TestCaseOperation1Request generates a "aws/request.Request" representing the
  383. // client's request for the OutputService4TestCaseOperation1 operation. The "output" return
  384. // value can be used to capture response data after the request's "Send" method
  385. // is called.
  386. //
  387. // Creating a request object using this method should be used when you want to inject
  388. // custom logic into the request's lifecycle using a custom handler, or if you want to
  389. // access properties on the request object before or after sending the request. If
  390. // you just want the service response, call the OutputService4TestCaseOperation1 method directly
  391. // instead.
  392. //
  393. // Note: You must call the "Send" method on the returned request object in order
  394. // to execute the request.
  395. //
  396. // // Example sending a request using the OutputService4TestCaseOperation1Request method.
  397. // req, resp := client.OutputService4TestCaseOperation1Request(params)
  398. //
  399. // err := req.Send()
  400. // if err == nil { // resp is now filled
  401. // fmt.Println(resp)
  402. // }
  403. //
  404. func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation1Output) {
  405. op := &request.Operation{
  406. Name: opOutputService4TestCaseOperation1,
  407. HTTPPath: "/",
  408. }
  409. if input == nil {
  410. input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{}
  411. }
  412. req = c.newRequest(op, input, output)
  413. output = &OutputService4TestShapeOutputService4TestCaseOperation1Output{}
  414. req.Data = output
  415. return
  416. }
  417. func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) {
  418. req, out := c.OutputService4TestCaseOperation1Request(input)
  419. err := req.Send()
  420. return out, err
  421. }
  422. type OutputService4TestShapeOutputService4TestCaseOperation1Input struct {
  423. _ struct{} `type:"structure"`
  424. }
  425. type OutputService4TestShapeOutputService4TestCaseOperation1Output struct {
  426. _ struct{} `type:"structure"`
  427. ListMember []*string `locationNameList:"item" type:"list"`
  428. }
  429. //The service client's operations are safe to be used concurrently.
  430. // It is not safe to mutate any of the client's properties though.
  431. type OutputService5ProtocolTest struct {
  432. *client.Client
  433. }
  434. // New creates a new instance of the OutputService5ProtocolTest client with a session.
  435. // If additional configuration is needed for the client instance use the optional
  436. // aws.Config parameter to add your extra config.
  437. //
  438. // Example:
  439. // // Create a OutputService5ProtocolTest client from just a session.
  440. // svc := outputservice5protocoltest.New(mySession)
  441. //
  442. // // Create a OutputService5ProtocolTest client with additional configuration
  443. // svc := outputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  444. func NewOutputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService5ProtocolTest {
  445. c := p.ClientConfig("outputservice5protocoltest", cfgs...)
  446. return newOutputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  447. }
  448. // newClient creates, initializes and returns a new service client instance.
  449. func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService5ProtocolTest {
  450. svc := &OutputService5ProtocolTest{
  451. Client: client.New(
  452. cfg,
  453. metadata.ClientInfo{
  454. ServiceName: "outputservice5protocoltest",
  455. SigningRegion: signingRegion,
  456. Endpoint: endpoint,
  457. APIVersion: "",
  458. },
  459. handlers,
  460. ),
  461. }
  462. // Handlers
  463. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  464. svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
  465. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  466. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  467. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
  468. return svc
  469. }
  470. // newRequest creates a new request for a OutputService5ProtocolTest operation and runs any
  471. // custom request initialization.
  472. func (c *OutputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  473. req := c.NewRequest(op, params, data)
  474. return req
  475. }
  476. const opOutputService5TestCaseOperation1 = "OperationName"
  477. // OutputService5TestCaseOperation1Request generates a "aws/request.Request" representing the
  478. // client's request for the OutputService5TestCaseOperation1 operation. The "output" return
  479. // value can be used to capture response data after the request's "Send" method
  480. // is called.
  481. //
  482. // Creating a request object using this method should be used when you want to inject
  483. // custom logic into the request's lifecycle using a custom handler, or if you want to
  484. // access properties on the request object before or after sending the request. If
  485. // you just want the service response, call the OutputService5TestCaseOperation1 method directly
  486. // instead.
  487. //
  488. // Note: You must call the "Send" method on the returned request object in order
  489. // to execute the request.
  490. //
  491. // // Example sending a request using the OutputService5TestCaseOperation1Request method.
  492. // req, resp := client.OutputService5TestCaseOperation1Request(params)
  493. //
  494. // err := req.Send()
  495. // if err == nil { // resp is now filled
  496. // fmt.Println(resp)
  497. // }
  498. //
  499. func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *request.Request, output *OutputService5TestShapeOutputService5TestCaseOperation1Output) {
  500. op := &request.Operation{
  501. Name: opOutputService5TestCaseOperation1,
  502. HTTPPath: "/",
  503. }
  504. if input == nil {
  505. input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{}
  506. }
  507. req = c.newRequest(op, input, output)
  508. output = &OutputService5TestShapeOutputService5TestCaseOperation1Output{}
  509. req.Data = output
  510. return
  511. }
  512. func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) {
  513. req, out := c.OutputService5TestCaseOperation1Request(input)
  514. err := req.Send()
  515. return out, err
  516. }
  517. type OutputService5TestShapeOutputService5TestCaseOperation1Input struct {
  518. _ struct{} `type:"structure"`
  519. }
  520. type OutputService5TestShapeOutputService5TestCaseOperation1Output struct {
  521. _ struct{} `type:"structure"`
  522. ListMember []*string `type:"list" flattened:"true"`
  523. }
  524. //The service client's operations are safe to be used concurrently.
  525. // It is not safe to mutate any of the client's properties though.
  526. type OutputService6ProtocolTest struct {
  527. *client.Client
  528. }
  529. // New creates a new instance of the OutputService6ProtocolTest client with a session.
  530. // If additional configuration is needed for the client instance use the optional
  531. // aws.Config parameter to add your extra config.
  532. //
  533. // Example:
  534. // // Create a OutputService6ProtocolTest client from just a session.
  535. // svc := outputservice6protocoltest.New(mySession)
  536. //
  537. // // Create a OutputService6ProtocolTest client with additional configuration
  538. // svc := outputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  539. func NewOutputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService6ProtocolTest {
  540. c := p.ClientConfig("outputservice6protocoltest", cfgs...)
  541. return newOutputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  542. }
  543. // newClient creates, initializes and returns a new service client instance.
  544. func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService6ProtocolTest {
  545. svc := &OutputService6ProtocolTest{
  546. Client: client.New(
  547. cfg,
  548. metadata.ClientInfo{
  549. ServiceName: "outputservice6protocoltest",
  550. SigningRegion: signingRegion,
  551. Endpoint: endpoint,
  552. APIVersion: "",
  553. },
  554. handlers,
  555. ),
  556. }
  557. // Handlers
  558. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  559. svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
  560. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  561. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  562. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
  563. return svc
  564. }
  565. // newRequest creates a new request for a OutputService6ProtocolTest operation and runs any
  566. // custom request initialization.
  567. func (c *OutputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  568. req := c.NewRequest(op, params, data)
  569. return req
  570. }
  571. const opOutputService6TestCaseOperation1 = "OperationName"
  572. // OutputService6TestCaseOperation1Request generates a "aws/request.Request" representing the
  573. // client's request for the OutputService6TestCaseOperation1 operation. The "output" return
  574. // value can be used to capture response data after the request's "Send" method
  575. // is called.
  576. //
  577. // Creating a request object using this method should be used when you want to inject
  578. // custom logic into the request's lifecycle using a custom handler, or if you want to
  579. // access properties on the request object before or after sending the request. If
  580. // you just want the service response, call the OutputService6TestCaseOperation1 method directly
  581. // instead.
  582. //
  583. // Note: You must call the "Send" method on the returned request object in order
  584. // to execute the request.
  585. //
  586. // // Example sending a request using the OutputService6TestCaseOperation1Request method.
  587. // req, resp := client.OutputService6TestCaseOperation1Request(params)
  588. //
  589. // err := req.Send()
  590. // if err == nil { // resp is now filled
  591. // fmt.Println(resp)
  592. // }
  593. //
  594. func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *request.Request, output *OutputService6TestShapeOutputService6TestCaseOperation1Output) {
  595. op := &request.Operation{
  596. Name: opOutputService6TestCaseOperation1,
  597. HTTPPath: "/",
  598. }
  599. if input == nil {
  600. input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{}
  601. }
  602. req = c.newRequest(op, input, output)
  603. output = &OutputService6TestShapeOutputService6TestCaseOperation1Output{}
  604. req.Data = output
  605. return
  606. }
  607. func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) {
  608. req, out := c.OutputService6TestCaseOperation1Request(input)
  609. err := req.Send()
  610. return out, err
  611. }
  612. type OutputService6TestShapeOutputService6TestCaseOperation1Input struct {
  613. _ struct{} `type:"structure"`
  614. }
  615. type OutputService6TestShapeOutputService6TestCaseOperation1Output struct {
  616. _ struct{} `type:"structure"`
  617. Map map[string]*OutputService6TestShapeStructureType `type:"map"`
  618. }
  619. type OutputService6TestShapeStructureType struct {
  620. _ struct{} `type:"structure"`
  621. Foo *string `locationName:"foo" type:"string"`
  622. }
  623. //The service client's operations are safe to be used concurrently.
  624. // It is not safe to mutate any of the client's properties though.
  625. type OutputService7ProtocolTest struct {
  626. *client.Client
  627. }
  628. // New creates a new instance of the OutputService7ProtocolTest client with a session.
  629. // If additional configuration is needed for the client instance use the optional
  630. // aws.Config parameter to add your extra config.
  631. //
  632. // Example:
  633. // // Create a OutputService7ProtocolTest client from just a session.
  634. // svc := outputservice7protocoltest.New(mySession)
  635. //
  636. // // Create a OutputService7ProtocolTest client with additional configuration
  637. // svc := outputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  638. func NewOutputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService7ProtocolTest {
  639. c := p.ClientConfig("outputservice7protocoltest", cfgs...)
  640. return newOutputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  641. }
  642. // newClient creates, initializes and returns a new service client instance.
  643. func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService7ProtocolTest {
  644. svc := &OutputService7ProtocolTest{
  645. Client: client.New(
  646. cfg,
  647. metadata.ClientInfo{
  648. ServiceName: "outputservice7protocoltest",
  649. SigningRegion: signingRegion,
  650. Endpoint: endpoint,
  651. APIVersion: "",
  652. },
  653. handlers,
  654. ),
  655. }
  656. // Handlers
  657. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  658. svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
  659. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  660. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  661. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
  662. return svc
  663. }
  664. // newRequest creates a new request for a OutputService7ProtocolTest operation and runs any
  665. // custom request initialization.
  666. func (c *OutputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  667. req := c.NewRequest(op, params, data)
  668. return req
  669. }
  670. const opOutputService7TestCaseOperation1 = "OperationName"
  671. // OutputService7TestCaseOperation1Request generates a "aws/request.Request" representing the
  672. // client's request for the OutputService7TestCaseOperation1 operation. The "output" return
  673. // value can be used to capture response data after the request's "Send" method
  674. // is called.
  675. //
  676. // Creating a request object using this method should be used when you want to inject
  677. // custom logic into the request's lifecycle using a custom handler, or if you want to
  678. // access properties on the request object before or after sending the request. If
  679. // you just want the service response, call the OutputService7TestCaseOperation1 method directly
  680. // instead.
  681. //
  682. // Note: You must call the "Send" method on the returned request object in order
  683. // to execute the request.
  684. //
  685. // // Example sending a request using the OutputService7TestCaseOperation1Request method.
  686. // req, resp := client.OutputService7TestCaseOperation1Request(params)
  687. //
  688. // err := req.Send()
  689. // if err == nil { // resp is now filled
  690. // fmt.Println(resp)
  691. // }
  692. //
  693. func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *request.Request, output *OutputService7TestShapeOutputService7TestCaseOperation1Output) {
  694. op := &request.Operation{
  695. Name: opOutputService7TestCaseOperation1,
  696. HTTPPath: "/",
  697. }
  698. if input == nil {
  699. input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{}
  700. }
  701. req = c.newRequest(op, input, output)
  702. output = &OutputService7TestShapeOutputService7TestCaseOperation1Output{}
  703. req.Data = output
  704. return
  705. }
  706. func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) {
  707. req, out := c.OutputService7TestCaseOperation1Request(input)
  708. err := req.Send()
  709. return out, err
  710. }
  711. type OutputService7TestShapeOutputService7TestCaseOperation1Input struct {
  712. _ struct{} `type:"structure"`
  713. }
  714. type OutputService7TestShapeOutputService7TestCaseOperation1Output struct {
  715. _ struct{} `type:"structure"`
  716. Map map[string]*string `type:"map" flattened:"true"`
  717. }
  718. //The service client's operations are safe to be used concurrently.
  719. // It is not safe to mutate any of the client's properties though.
  720. type OutputService8ProtocolTest struct {
  721. *client.Client
  722. }
  723. // New creates a new instance of the OutputService8ProtocolTest client with a session.
  724. // If additional configuration is needed for the client instance use the optional
  725. // aws.Config parameter to add your extra config.
  726. //
  727. // Example:
  728. // // Create a OutputService8ProtocolTest client from just a session.
  729. // svc := outputservice8protocoltest.New(mySession)
  730. //
  731. // // Create a OutputService8ProtocolTest client with additional configuration
  732. // svc := outputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  733. func NewOutputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService8ProtocolTest {
  734. c := p.ClientConfig("outputservice8protocoltest", cfgs...)
  735. return newOutputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  736. }
  737. // newClient creates, initializes and returns a new service client instance.
  738. func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService8ProtocolTest {
  739. svc := &OutputService8ProtocolTest{
  740. Client: client.New(
  741. cfg,
  742. metadata.ClientInfo{
  743. ServiceName: "outputservice8protocoltest",
  744. SigningRegion: signingRegion,
  745. Endpoint: endpoint,
  746. APIVersion: "",
  747. },
  748. handlers,
  749. ),
  750. }
  751. // Handlers
  752. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  753. svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
  754. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  755. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  756. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
  757. return svc
  758. }
  759. // newRequest creates a new request for a OutputService8ProtocolTest operation and runs any
  760. // custom request initialization.
  761. func (c *OutputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  762. req := c.NewRequest(op, params, data)
  763. return req
  764. }
  765. const opOutputService8TestCaseOperation1 = "OperationName"
  766. // OutputService8TestCaseOperation1Request generates a "aws/request.Request" representing the
  767. // client's request for the OutputService8TestCaseOperation1 operation. The "output" return
  768. // value can be used to capture response data after the request's "Send" method
  769. // is called.
  770. //
  771. // Creating a request object using this method should be used when you want to inject
  772. // custom logic into the request's lifecycle using a custom handler, or if you want to
  773. // access properties on the request object before or after sending the request. If
  774. // you just want the service response, call the OutputService8TestCaseOperation1 method directly
  775. // instead.
  776. //
  777. // Note: You must call the "Send" method on the returned request object in order
  778. // to execute the request.
  779. //
  780. // // Example sending a request using the OutputService8TestCaseOperation1Request method.
  781. // req, resp := client.OutputService8TestCaseOperation1Request(params)
  782. //
  783. // err := req.Send()
  784. // if err == nil { // resp is now filled
  785. // fmt.Println(resp)
  786. // }
  787. //
  788. func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *request.Request, output *OutputService8TestShapeOutputService8TestCaseOperation1Output) {
  789. op := &request.Operation{
  790. Name: opOutputService8TestCaseOperation1,
  791. HTTPPath: "/",
  792. }
  793. if input == nil {
  794. input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{}
  795. }
  796. req = c.newRequest(op, input, output)
  797. output = &OutputService8TestShapeOutputService8TestCaseOperation1Output{}
  798. req.Data = output
  799. return
  800. }
  801. func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) {
  802. req, out := c.OutputService8TestCaseOperation1Request(input)
  803. err := req.Send()
  804. return out, err
  805. }
  806. type OutputService8TestShapeOutputService8TestCaseOperation1Input struct {
  807. _ struct{} `type:"structure"`
  808. }
  809. type OutputService8TestShapeOutputService8TestCaseOperation1Output struct {
  810. _ struct{} `type:"structure"`
  811. Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"`
  812. }
  813. //The service client's operations are safe to be used concurrently.
  814. // It is not safe to mutate any of the client's properties though.
  815. type OutputService9ProtocolTest struct {
  816. *client.Client
  817. }
  818. // New creates a new instance of the OutputService9ProtocolTest client with a session.
  819. // If additional configuration is needed for the client instance use the optional
  820. // aws.Config parameter to add your extra config.
  821. //
  822. // Example:
  823. // // Create a OutputService9ProtocolTest client from just a session.
  824. // svc := outputservice9protocoltest.New(mySession)
  825. //
  826. // // Create a OutputService9ProtocolTest client with additional configuration
  827. // svc := outputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  828. func NewOutputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService9ProtocolTest {
  829. c := p.ClientConfig("outputservice9protocoltest", cfgs...)
  830. return newOutputService9ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  831. }
  832. // newClient creates, initializes and returns a new service client instance.
  833. func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService9ProtocolTest {
  834. svc := &OutputService9ProtocolTest{
  835. Client: client.New(
  836. cfg,
  837. metadata.ClientInfo{
  838. ServiceName: "outputservice9protocoltest",
  839. SigningRegion: signingRegion,
  840. Endpoint: endpoint,
  841. APIVersion: "",
  842. },
  843. handlers,
  844. ),
  845. }
  846. // Handlers
  847. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  848. svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
  849. svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
  850. svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
  851. svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
  852. return svc
  853. }
  854. // newRequest creates a new request for a OutputService9ProtocolTest operation and runs any
  855. // custom request initialization.
  856. func (c *OutputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  857. req := c.NewRequest(op, params, data)
  858. return req
  859. }
  860. const opOutputService9TestCaseOperation1 = "OperationName"
  861. // OutputService9TestCaseOperation1Request generates a "aws/request.Request" representing the
  862. // client's request for the OutputService9TestCaseOperation1 operation. The "output" return
  863. // value can be used to capture response data after the request's "Send" method
  864. // is called.
  865. //
  866. // Creating a request object using this method should be used when you want to inject
  867. // custom logic into the request's lifecycle using a custom handler, or if you want to
  868. // access properties on the request object before or after sending the request. If
  869. // you just want the service response, call the OutputService9TestCaseOperation1 method directly
  870. // instead.
  871. //
  872. // Note: You must call the "Send" method on the returned request object in order
  873. // to execute the request.
  874. //
  875. // // Example sending a request using the OutputService9TestCaseOperation1Request method.
  876. // req, resp := client.OutputService9TestCaseOperation1Request(params)
  877. //
  878. // err := req.Send()
  879. // if err == nil { // resp is now filled
  880. // fmt.Println(resp)
  881. // }
  882. //
  883. func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *request.Request, output *OutputService9TestShapeOutputService9TestCaseOperation1Output) {
  884. op := &request.Operation{
  885. Name: opOutputService9TestCaseOperation1,
  886. HTTPPath: "/",
  887. }
  888. if input == nil {
  889. input = &OutputService9TestShapeOutputService9TestCaseOperation1Input{}
  890. }
  891. req = c.newRequest(op, input, output)
  892. output = &OutputService9TestShapeOutputService9TestCaseOperation1Output{}
  893. req.Data = output
  894. return
  895. }
  896. func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) {
  897. req, out := c.OutputService9TestCaseOperation1Request(input)
  898. err := req.Send()
  899. return out, err
  900. }
  901. type OutputService9TestShapeOutputService9TestCaseOperation1Input struct {
  902. _ struct{} `type:"structure"`
  903. }
  904. type OutputService9TestShapeOutputService9TestCaseOperation1Output struct {
  905. _ struct{} `type:"structure"`
  906. Foo *string `type:"string"`
  907. }
  908. //
  909. // Tests begin here
  910. //
  911. func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
  912. svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  913. 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><RequestId>request-id</RequestId></OperationNameResponse>"))
  914. req, out := svc.OutputService1TestCaseOperation1Request(nil)
  915. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  916. // set headers
  917. // unmarshal response
  918. ec2query.UnmarshalMeta(req)
  919. ec2query.Unmarshal(req)
  920. assert.NoError(t, req.Error)
  921. // assert response
  922. assert.NotNil(t, out) // ensure out variable is used
  923. assert.Equal(t, "a", *out.Char)
  924. assert.Equal(t, 1.3, *out.Double)
  925. assert.Equal(t, false, *out.FalseBool)
  926. assert.Equal(t, 1.2, *out.Float)
  927. assert.Equal(t, int64(200), *out.Long)
  928. assert.Equal(t, int64(123), *out.Num)
  929. assert.Equal(t, "myname", *out.Str)
  930. assert.Equal(t, true, *out.TrueBool)
  931. }
  932. func TestOutputService2ProtocolTestBlobCase1(t *testing.T) {
  933. svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  934. buf := bytes.NewReader([]byte("<OperationNameResponse><Blob>dmFsdWU=</Blob><RequestId>requestid</RequestId></OperationNameResponse>"))
  935. req, out := svc.OutputService2TestCaseOperation1Request(nil)
  936. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  937. // set headers
  938. // unmarshal response
  939. ec2query.UnmarshalMeta(req)
  940. ec2query.Unmarshal(req)
  941. assert.NoError(t, req.Error)
  942. // assert response
  943. assert.NotNil(t, out) // ensure out variable is used
  944. assert.Equal(t, "value", string(out.Blob))
  945. }
  946. func TestOutputService3ProtocolTestListsCase1(t *testing.T) {
  947. svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  948. buf := bytes.NewReader([]byte("<OperationNameResponse><ListMember><member>abc</member><member>123</member></ListMember><RequestId>requestid</RequestId></OperationNameResponse>"))
  949. req, out := svc.OutputService3TestCaseOperation1Request(nil)
  950. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  951. // set headers
  952. // unmarshal response
  953. ec2query.UnmarshalMeta(req)
  954. ec2query.Unmarshal(req)
  955. assert.NoError(t, req.Error)
  956. // assert response
  957. assert.NotNil(t, out) // ensure out variable is used
  958. assert.Equal(t, "abc", *out.ListMember[0])
  959. assert.Equal(t, "123", *out.ListMember[1])
  960. }
  961. func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
  962. svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  963. buf := bytes.NewReader([]byte("<OperationNameResponse><ListMember><item>abc</item><item>123</item></ListMember><RequestId>requestid</RequestId></OperationNameResponse>"))
  964. req, out := svc.OutputService4TestCaseOperation1Request(nil)
  965. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  966. // set headers
  967. // unmarshal response
  968. ec2query.UnmarshalMeta(req)
  969. ec2query.Unmarshal(req)
  970. assert.NoError(t, req.Error)
  971. // assert response
  972. assert.NotNil(t, out) // ensure out variable is used
  973. assert.Equal(t, "abc", *out.ListMember[0])
  974. assert.Equal(t, "123", *out.ListMember[1])
  975. }
  976. func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) {
  977. svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  978. buf := bytes.NewReader([]byte("<OperationNameResponse><ListMember>abc</ListMember><ListMember>123</ListMember><RequestId>requestid</RequestId></OperationNameResponse>"))
  979. req, out := svc.OutputService5TestCaseOperation1Request(nil)
  980. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  981. // set headers
  982. // unmarshal response
  983. ec2query.UnmarshalMeta(req)
  984. ec2query.Unmarshal(req)
  985. assert.NoError(t, req.Error)
  986. // assert response
  987. assert.NotNil(t, out) // ensure out variable is used
  988. assert.Equal(t, "abc", *out.ListMember[0])
  989. assert.Equal(t, "123", *out.ListMember[1])
  990. }
  991. func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) {
  992. svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  993. buf := bytes.NewReader([]byte("<OperationNameResponse><Map><entry><key>qux</key><value><foo>bar</foo></value></entry><entry><key>baz</key><value><foo>bam</foo></value></entry></Map><RequestId>requestid</RequestId></OperationNameResponse>"))
  994. req, out := svc.OutputService6TestCaseOperation1Request(nil)
  995. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  996. // set headers
  997. // unmarshal response
  998. ec2query.UnmarshalMeta(req)
  999. ec2query.Unmarshal(req)
  1000. assert.NoError(t, req.Error)
  1001. // assert response
  1002. assert.NotNil(t, out) // ensure out variable is used
  1003. assert.Equal(t, "bam", *out.Map["baz"].Foo)
  1004. assert.Equal(t, "bar", *out.Map["qux"].Foo)
  1005. }
  1006. func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) {
  1007. svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1008. buf := bytes.NewReader([]byte("<OperationNameResponse><Map><key>qux</key><value>bar</value></Map><Map><key>baz</key><value>bam</value></Map><RequestId>requestid</RequestId></OperationNameResponse>"))
  1009. req, out := svc.OutputService7TestCaseOperation1Request(nil)
  1010. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1011. // set headers
  1012. // unmarshal response
  1013. ec2query.UnmarshalMeta(req)
  1014. ec2query.Unmarshal(req)
  1015. assert.NoError(t, req.Error)
  1016. // assert response
  1017. assert.NotNil(t, out) // ensure out variable is used
  1018. assert.Equal(t, "bam", *out.Map["baz"])
  1019. assert.Equal(t, "bar", *out.Map["qux"])
  1020. }
  1021. func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) {
  1022. svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1023. buf := bytes.NewReader([]byte("<OperationNameResponse><Map><foo>qux</foo><bar>bar</bar></Map><Map><foo>baz</foo><bar>bam</bar></Map><RequestId>requestid</RequestId></OperationNameResponse>"))
  1024. req, out := svc.OutputService8TestCaseOperation1Request(nil)
  1025. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1026. // set headers
  1027. // unmarshal response
  1028. ec2query.UnmarshalMeta(req)
  1029. ec2query.Unmarshal(req)
  1030. assert.NoError(t, req.Error)
  1031. // assert response
  1032. assert.NotNil(t, out) // ensure out variable is used
  1033. assert.Equal(t, "bam", *out.Map["baz"])
  1034. assert.Equal(t, "bar", *out.Map["qux"])
  1035. }
  1036. func TestOutputService9ProtocolTestEmptyStringCase1(t *testing.T) {
  1037. svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1038. buf := bytes.NewReader([]byte("<OperationNameResponse><Foo/><RequestId>requestid</RequestId></OperationNameResponse>"))
  1039. req, out := svc.OutputService9TestCaseOperation1Request(nil)
  1040. req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
  1041. // set headers
  1042. // unmarshal response
  1043. ec2query.UnmarshalMeta(req)
  1044. ec2query.Unmarshal(req)
  1045. assert.NoError(t, req.Error)
  1046. // assert response
  1047. assert.NotNil(t, out) // ensure out variable is used
  1048. assert.Equal(t, "", *out.Foo)
  1049. }