unmarshal_test.go 51 KB

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