unmarshal_test.go 63 KB

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