build_test.go 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637
  1. package jsonrpc_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/jsonrpc"
  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 InputService1ProtocolTest struct {
  44. *client.Client
  45. }
  46. // New creates a new instance of the InputService1ProtocolTest 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 InputService1ProtocolTest client from just a session.
  52. // svc := inputservice1protocoltest.New(mySession)
  53. //
  54. // // Create a InputService1ProtocolTest client with additional configuration
  55. // svc := inputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  56. func NewInputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService1ProtocolTest {
  57. c := p.ClientConfig("inputservice1protocoltest", cfgs...)
  58. return newInputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  59. }
  60. // newClient creates, initializes and returns a new service client instance.
  61. func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService1ProtocolTest {
  62. svc := &InputService1ProtocolTest{
  63. Client: client.New(
  64. cfg,
  65. metadata.ClientInfo{
  66. ServiceName: "inputservice1protocoltest",
  67. SigningRegion: signingRegion,
  68. Endpoint: endpoint,
  69. APIVersion: "",
  70. JSONVersion: "1.1",
  71. TargetPrefix: "com.amazonaws.foo",
  72. },
  73. handlers,
  74. ),
  75. }
  76. // Handlers
  77. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  78. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  79. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  80. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  81. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  82. return svc
  83. }
  84. // newRequest creates a new request for a InputService1ProtocolTest operation and runs any
  85. // custom request initialization.
  86. func (c *InputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  87. req := c.NewRequest(op, params, data)
  88. return req
  89. }
  90. const opInputService1TestCaseOperation1 = "OperationName"
  91. // InputService1TestCaseOperation1Request generates a "aws/request.Request" representing the
  92. // client's request for the InputService1TestCaseOperation1 operation. The "output" return
  93. // value can be used to capture response data after the request's "Send" method
  94. // is called.
  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 InputService1TestCaseOperation1 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 InputService1TestCaseOperation1Request method.
  106. // req, resp := client.InputService1TestCaseOperation1Request(params)
  107. //
  108. // err := req.Send()
  109. // if err == nil { // resp is now filled
  110. // fmt.Println(resp)
  111. // }
  112. //
  113. func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputService1TestCaseOperation1Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) {
  114. op := &request.Operation{
  115. Name: opInputService1TestCaseOperation1,
  116. HTTPMethod: "POST",
  117. HTTPPath: "/",
  118. }
  119. if input == nil {
  120. input = &InputService1TestShapeInputService1TestCaseOperation1Input{}
  121. }
  122. req = c.newRequest(op, input, output)
  123. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  124. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  125. output = &InputService1TestShapeInputService1TestCaseOperation1Output{}
  126. req.Data = output
  127. return
  128. }
  129. func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputService1TestCaseOperation1Input) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) {
  130. req, out := c.InputService1TestCaseOperation1Request(input)
  131. err := req.Send()
  132. return out, err
  133. }
  134. type InputService1TestShapeInputService1TestCaseOperation1Input struct {
  135. _ struct{} `type:"structure"`
  136. Name *string `type:"string"`
  137. }
  138. type InputService1TestShapeInputService1TestCaseOperation1Output struct {
  139. _ struct{} `type:"structure"`
  140. }
  141. //The service client's operations are safe to be used concurrently.
  142. // It is not safe to mutate any of the client's properties though.
  143. type InputService2ProtocolTest struct {
  144. *client.Client
  145. }
  146. // New creates a new instance of the InputService2ProtocolTest client with a session.
  147. // If additional configuration is needed for the client instance use the optional
  148. // aws.Config parameter to add your extra config.
  149. //
  150. // Example:
  151. // // Create a InputService2ProtocolTest client from just a session.
  152. // svc := inputservice2protocoltest.New(mySession)
  153. //
  154. // // Create a InputService2ProtocolTest client with additional configuration
  155. // svc := inputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  156. func NewInputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService2ProtocolTest {
  157. c := p.ClientConfig("inputservice2protocoltest", cfgs...)
  158. return newInputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  159. }
  160. // newClient creates, initializes and returns a new service client instance.
  161. func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService2ProtocolTest {
  162. svc := &InputService2ProtocolTest{
  163. Client: client.New(
  164. cfg,
  165. metadata.ClientInfo{
  166. ServiceName: "inputservice2protocoltest",
  167. SigningRegion: signingRegion,
  168. Endpoint: endpoint,
  169. APIVersion: "",
  170. JSONVersion: "1.1",
  171. TargetPrefix: "com.amazonaws.foo",
  172. },
  173. handlers,
  174. ),
  175. }
  176. // Handlers
  177. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  178. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  179. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  180. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  181. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  182. return svc
  183. }
  184. // newRequest creates a new request for a InputService2ProtocolTest operation and runs any
  185. // custom request initialization.
  186. func (c *InputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  187. req := c.NewRequest(op, params, data)
  188. return req
  189. }
  190. const opInputService2TestCaseOperation1 = "OperationName"
  191. // InputService2TestCaseOperation1Request generates a "aws/request.Request" representing the
  192. // client's request for the InputService2TestCaseOperation1 operation. The "output" return
  193. // value can be used to capture response data after the request's "Send" method
  194. // is called.
  195. //
  196. // Creating a request object using this method should be used when you want to inject
  197. // custom logic into the request's lifecycle using a custom handler, or if you want to
  198. // access properties on the request object before or after sending the request. If
  199. // you just want the service response, call the InputService2TestCaseOperation1 method directly
  200. // instead.
  201. //
  202. // Note: You must call the "Send" method on the returned request object in order
  203. // to execute the request.
  204. //
  205. // // Example sending a request using the InputService2TestCaseOperation1Request method.
  206. // req, resp := client.InputService2TestCaseOperation1Request(params)
  207. //
  208. // err := req.Send()
  209. // if err == nil { // resp is now filled
  210. // fmt.Println(resp)
  211. // }
  212. //
  213. func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputService2TestCaseOperation1Input) (req *request.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) {
  214. op := &request.Operation{
  215. Name: opInputService2TestCaseOperation1,
  216. HTTPPath: "/",
  217. }
  218. if input == nil {
  219. input = &InputService2TestShapeInputService2TestCaseOperation1Input{}
  220. }
  221. req = c.newRequest(op, input, output)
  222. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  223. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  224. output = &InputService2TestShapeInputService2TestCaseOperation1Output{}
  225. req.Data = output
  226. return
  227. }
  228. func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputService2TestCaseOperation1Input) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) {
  229. req, out := c.InputService2TestCaseOperation1Request(input)
  230. err := req.Send()
  231. return out, err
  232. }
  233. type InputService2TestShapeInputService2TestCaseOperation1Input struct {
  234. _ struct{} `type:"structure"`
  235. TimeArg *time.Time `type:"timestamp" timestampFormat:"unix"`
  236. }
  237. type InputService2TestShapeInputService2TestCaseOperation1Output struct {
  238. _ struct{} `type:"structure"`
  239. }
  240. //The service client's operations are safe to be used concurrently.
  241. // It is not safe to mutate any of the client's properties though.
  242. type InputService3ProtocolTest struct {
  243. *client.Client
  244. }
  245. // New creates a new instance of the InputService3ProtocolTest client with a session.
  246. // If additional configuration is needed for the client instance use the optional
  247. // aws.Config parameter to add your extra config.
  248. //
  249. // Example:
  250. // // Create a InputService3ProtocolTest client from just a session.
  251. // svc := inputservice3protocoltest.New(mySession)
  252. //
  253. // // Create a InputService3ProtocolTest client with additional configuration
  254. // svc := inputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  255. func NewInputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService3ProtocolTest {
  256. c := p.ClientConfig("inputservice3protocoltest", cfgs...)
  257. return newInputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  258. }
  259. // newClient creates, initializes and returns a new service client instance.
  260. func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService3ProtocolTest {
  261. svc := &InputService3ProtocolTest{
  262. Client: client.New(
  263. cfg,
  264. metadata.ClientInfo{
  265. ServiceName: "inputservice3protocoltest",
  266. SigningRegion: signingRegion,
  267. Endpoint: endpoint,
  268. APIVersion: "",
  269. JSONVersion: "1.1",
  270. TargetPrefix: "com.amazonaws.foo",
  271. },
  272. handlers,
  273. ),
  274. }
  275. // Handlers
  276. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  277. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  278. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  279. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  280. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  281. return svc
  282. }
  283. // newRequest creates a new request for a InputService3ProtocolTest operation and runs any
  284. // custom request initialization.
  285. func (c *InputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  286. req := c.NewRequest(op, params, data)
  287. return req
  288. }
  289. const opInputService3TestCaseOperation1 = "OperationName"
  290. // InputService3TestCaseOperation1Request generates a "aws/request.Request" representing the
  291. // client's request for the InputService3TestCaseOperation1 operation. The "output" return
  292. // value can be used to capture response data after the request's "Send" method
  293. // is called.
  294. //
  295. // Creating a request object using this method should be used when you want to inject
  296. // custom logic into the request's lifecycle using a custom handler, or if you want to
  297. // access properties on the request object before or after sending the request. If
  298. // you just want the service response, call the InputService3TestCaseOperation1 method directly
  299. // instead.
  300. //
  301. // Note: You must call the "Send" method on the returned request object in order
  302. // to execute the request.
  303. //
  304. // // Example sending a request using the InputService3TestCaseOperation1Request method.
  305. // req, resp := client.InputService3TestCaseOperation1Request(params)
  306. //
  307. // err := req.Send()
  308. // if err == nil { // resp is now filled
  309. // fmt.Println(resp)
  310. // }
  311. //
  312. func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputShape) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) {
  313. op := &request.Operation{
  314. Name: opInputService3TestCaseOperation1,
  315. HTTPPath: "/",
  316. }
  317. if input == nil {
  318. input = &InputService3TestShapeInputShape{}
  319. }
  320. req = c.newRequest(op, input, output)
  321. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  322. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  323. output = &InputService3TestShapeInputService3TestCaseOperation1Output{}
  324. req.Data = output
  325. return
  326. }
  327. func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) {
  328. req, out := c.InputService3TestCaseOperation1Request(input)
  329. err := req.Send()
  330. return out, err
  331. }
  332. const opInputService3TestCaseOperation2 = "OperationName"
  333. // InputService3TestCaseOperation2Request generates a "aws/request.Request" representing the
  334. // client's request for the InputService3TestCaseOperation2 operation. The "output" return
  335. // value can be used to capture response data after the request's "Send" method
  336. // is called.
  337. //
  338. // Creating a request object using this method should be used when you want to inject
  339. // custom logic into the request's lifecycle using a custom handler, or if you want to
  340. // access properties on the request object before or after sending the request. If
  341. // you just want the service response, call the InputService3TestCaseOperation2 method directly
  342. // instead.
  343. //
  344. // Note: You must call the "Send" method on the returned request object in order
  345. // to execute the request.
  346. //
  347. // // Example sending a request using the InputService3TestCaseOperation2Request method.
  348. // req, resp := client.InputService3TestCaseOperation2Request(params)
  349. //
  350. // err := req.Send()
  351. // if err == nil { // resp is now filled
  352. // fmt.Println(resp)
  353. // }
  354. //
  355. func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input *InputService3TestShapeInputShape) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation2Output) {
  356. op := &request.Operation{
  357. Name: opInputService3TestCaseOperation2,
  358. HTTPPath: "/",
  359. }
  360. if input == nil {
  361. input = &InputService3TestShapeInputShape{}
  362. }
  363. req = c.newRequest(op, input, output)
  364. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  365. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  366. output = &InputService3TestShapeInputService3TestCaseOperation2Output{}
  367. req.Data = output
  368. return
  369. }
  370. func (c *InputService3ProtocolTest) InputService3TestCaseOperation2(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) {
  371. req, out := c.InputService3TestCaseOperation2Request(input)
  372. err := req.Send()
  373. return out, err
  374. }
  375. type InputService3TestShapeInputService3TestCaseOperation1Output struct {
  376. _ struct{} `type:"structure"`
  377. }
  378. type InputService3TestShapeInputService3TestCaseOperation2Output struct {
  379. _ struct{} `type:"structure"`
  380. }
  381. type InputService3TestShapeInputShape struct {
  382. _ struct{} `type:"structure"`
  383. // BlobArg is automatically base64 encoded/decoded by the SDK.
  384. BlobArg []byte `type:"blob"`
  385. BlobMap map[string][]byte `type:"map"`
  386. }
  387. //The service client's operations are safe to be used concurrently.
  388. // It is not safe to mutate any of the client's properties though.
  389. type InputService4ProtocolTest struct {
  390. *client.Client
  391. }
  392. // New creates a new instance of the InputService4ProtocolTest client with a session.
  393. // If additional configuration is needed for the client instance use the optional
  394. // aws.Config parameter to add your extra config.
  395. //
  396. // Example:
  397. // // Create a InputService4ProtocolTest client from just a session.
  398. // svc := inputservice4protocoltest.New(mySession)
  399. //
  400. // // Create a InputService4ProtocolTest client with additional configuration
  401. // svc := inputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  402. func NewInputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService4ProtocolTest {
  403. c := p.ClientConfig("inputservice4protocoltest", cfgs...)
  404. return newInputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  405. }
  406. // newClient creates, initializes and returns a new service client instance.
  407. func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService4ProtocolTest {
  408. svc := &InputService4ProtocolTest{
  409. Client: client.New(
  410. cfg,
  411. metadata.ClientInfo{
  412. ServiceName: "inputservice4protocoltest",
  413. SigningRegion: signingRegion,
  414. Endpoint: endpoint,
  415. APIVersion: "",
  416. JSONVersion: "1.1",
  417. TargetPrefix: "com.amazonaws.foo",
  418. },
  419. handlers,
  420. ),
  421. }
  422. // Handlers
  423. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  424. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  425. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  426. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  427. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  428. return svc
  429. }
  430. // newRequest creates a new request for a InputService4ProtocolTest operation and runs any
  431. // custom request initialization.
  432. func (c *InputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  433. req := c.NewRequest(op, params, data)
  434. return req
  435. }
  436. const opInputService4TestCaseOperation1 = "OperationName"
  437. // InputService4TestCaseOperation1Request generates a "aws/request.Request" representing the
  438. // client's request for the InputService4TestCaseOperation1 operation. The "output" return
  439. // value can be used to capture response data after the request's "Send" method
  440. // is called.
  441. //
  442. // Creating a request object using this method should be used when you want to inject
  443. // custom logic into the request's lifecycle using a custom handler, or if you want to
  444. // access properties on the request object before or after sending the request. If
  445. // you just want the service response, call the InputService4TestCaseOperation1 method directly
  446. // instead.
  447. //
  448. // Note: You must call the "Send" method on the returned request object in order
  449. // to execute the request.
  450. //
  451. // // Example sending a request using the InputService4TestCaseOperation1Request method.
  452. // req, resp := client.InputService4TestCaseOperation1Request(params)
  453. //
  454. // err := req.Send()
  455. // if err == nil { // resp is now filled
  456. // fmt.Println(resp)
  457. // }
  458. //
  459. func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputService4TestCaseOperation1Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) {
  460. op := &request.Operation{
  461. Name: opInputService4TestCaseOperation1,
  462. HTTPMethod: "POST",
  463. HTTPPath: "/",
  464. }
  465. if input == nil {
  466. input = &InputService4TestShapeInputService4TestCaseOperation1Input{}
  467. }
  468. req = c.newRequest(op, input, output)
  469. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  470. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  471. output = &InputService4TestShapeInputService4TestCaseOperation1Output{}
  472. req.Data = output
  473. return
  474. }
  475. func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputService4TestCaseOperation1Input) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) {
  476. req, out := c.InputService4TestCaseOperation1Request(input)
  477. err := req.Send()
  478. return out, err
  479. }
  480. type InputService4TestShapeInputService4TestCaseOperation1Input struct {
  481. _ struct{} `type:"structure"`
  482. ListParam [][]byte `type:"list"`
  483. }
  484. type InputService4TestShapeInputService4TestCaseOperation1Output struct {
  485. _ struct{} `type:"structure"`
  486. }
  487. //The service client's operations are safe to be used concurrently.
  488. // It is not safe to mutate any of the client's properties though.
  489. type InputService5ProtocolTest struct {
  490. *client.Client
  491. }
  492. // New creates a new instance of the InputService5ProtocolTest client with a session.
  493. // If additional configuration is needed for the client instance use the optional
  494. // aws.Config parameter to add your extra config.
  495. //
  496. // Example:
  497. // // Create a InputService5ProtocolTest client from just a session.
  498. // svc := inputservice5protocoltest.New(mySession)
  499. //
  500. // // Create a InputService5ProtocolTest client with additional configuration
  501. // svc := inputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  502. func NewInputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService5ProtocolTest {
  503. c := p.ClientConfig("inputservice5protocoltest", cfgs...)
  504. return newInputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  505. }
  506. // newClient creates, initializes and returns a new service client instance.
  507. func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService5ProtocolTest {
  508. svc := &InputService5ProtocolTest{
  509. Client: client.New(
  510. cfg,
  511. metadata.ClientInfo{
  512. ServiceName: "inputservice5protocoltest",
  513. SigningRegion: signingRegion,
  514. Endpoint: endpoint,
  515. APIVersion: "",
  516. JSONVersion: "1.1",
  517. TargetPrefix: "com.amazonaws.foo",
  518. },
  519. handlers,
  520. ),
  521. }
  522. // Handlers
  523. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  524. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  525. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  526. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  527. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  528. return svc
  529. }
  530. // newRequest creates a new request for a InputService5ProtocolTest operation and runs any
  531. // custom request initialization.
  532. func (c *InputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  533. req := c.NewRequest(op, params, data)
  534. return req
  535. }
  536. const opInputService5TestCaseOperation1 = "OperationName"
  537. // InputService5TestCaseOperation1Request generates a "aws/request.Request" representing the
  538. // client's request for the InputService5TestCaseOperation1 operation. The "output" return
  539. // value can be used to capture response data after the request's "Send" method
  540. // is called.
  541. //
  542. // Creating a request object using this method should be used when you want to inject
  543. // custom logic into the request's lifecycle using a custom handler, or if you want to
  544. // access properties on the request object before or after sending the request. If
  545. // you just want the service response, call the InputService5TestCaseOperation1 method directly
  546. // instead.
  547. //
  548. // Note: You must call the "Send" method on the returned request object in order
  549. // to execute the request.
  550. //
  551. // // Example sending a request using the InputService5TestCaseOperation1Request method.
  552. // req, resp := client.InputService5TestCaseOperation1Request(params)
  553. //
  554. // err := req.Send()
  555. // if err == nil { // resp is now filled
  556. // fmt.Println(resp)
  557. // }
  558. //
  559. func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputShape) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) {
  560. op := &request.Operation{
  561. Name: opInputService5TestCaseOperation1,
  562. HTTPPath: "/",
  563. }
  564. if input == nil {
  565. input = &InputService5TestShapeInputShape{}
  566. }
  567. req = c.newRequest(op, input, output)
  568. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  569. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  570. output = &InputService5TestShapeInputService5TestCaseOperation1Output{}
  571. req.Data = output
  572. return
  573. }
  574. func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) {
  575. req, out := c.InputService5TestCaseOperation1Request(input)
  576. err := req.Send()
  577. return out, err
  578. }
  579. const opInputService5TestCaseOperation2 = "OperationName"
  580. // InputService5TestCaseOperation2Request generates a "aws/request.Request" representing the
  581. // client's request for the InputService5TestCaseOperation2 operation. The "output" return
  582. // value can be used to capture response data after the request's "Send" method
  583. // is called.
  584. //
  585. // Creating a request object using this method should be used when you want to inject
  586. // custom logic into the request's lifecycle using a custom handler, or if you want to
  587. // access properties on the request object before or after sending the request. If
  588. // you just want the service response, call the InputService5TestCaseOperation2 method directly
  589. // instead.
  590. //
  591. // Note: You must call the "Send" method on the returned request object in order
  592. // to execute the request.
  593. //
  594. // // Example sending a request using the InputService5TestCaseOperation2Request method.
  595. // req, resp := client.InputService5TestCaseOperation2Request(params)
  596. //
  597. // err := req.Send()
  598. // if err == nil { // resp is now filled
  599. // fmt.Println(resp)
  600. // }
  601. //
  602. func (c *InputService5ProtocolTest) InputService5TestCaseOperation2Request(input *InputService5TestShapeInputShape) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation2Output) {
  603. op := &request.Operation{
  604. Name: opInputService5TestCaseOperation2,
  605. HTTPPath: "/",
  606. }
  607. if input == nil {
  608. input = &InputService5TestShapeInputShape{}
  609. }
  610. req = c.newRequest(op, input, output)
  611. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  612. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  613. output = &InputService5TestShapeInputService5TestCaseOperation2Output{}
  614. req.Data = output
  615. return
  616. }
  617. func (c *InputService5ProtocolTest) InputService5TestCaseOperation2(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation2Output, error) {
  618. req, out := c.InputService5TestCaseOperation2Request(input)
  619. err := req.Send()
  620. return out, err
  621. }
  622. const opInputService5TestCaseOperation3 = "OperationName"
  623. // InputService5TestCaseOperation3Request generates a "aws/request.Request" representing the
  624. // client's request for the InputService5TestCaseOperation3 operation. The "output" return
  625. // value can be used to capture response data after the request's "Send" method
  626. // is called.
  627. //
  628. // Creating a request object using this method should be used when you want to inject
  629. // custom logic into the request's lifecycle using a custom handler, or if you want to
  630. // access properties on the request object before or after sending the request. If
  631. // you just want the service response, call the InputService5TestCaseOperation3 method directly
  632. // instead.
  633. //
  634. // Note: You must call the "Send" method on the returned request object in order
  635. // to execute the request.
  636. //
  637. // // Example sending a request using the InputService5TestCaseOperation3Request method.
  638. // req, resp := client.InputService5TestCaseOperation3Request(params)
  639. //
  640. // err := req.Send()
  641. // if err == nil { // resp is now filled
  642. // fmt.Println(resp)
  643. // }
  644. //
  645. func (c *InputService5ProtocolTest) InputService5TestCaseOperation3Request(input *InputService5TestShapeInputShape) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation3Output) {
  646. op := &request.Operation{
  647. Name: opInputService5TestCaseOperation3,
  648. HTTPPath: "/",
  649. }
  650. if input == nil {
  651. input = &InputService5TestShapeInputShape{}
  652. }
  653. req = c.newRequest(op, input, output)
  654. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  655. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  656. output = &InputService5TestShapeInputService5TestCaseOperation3Output{}
  657. req.Data = output
  658. return
  659. }
  660. func (c *InputService5ProtocolTest) InputService5TestCaseOperation3(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation3Output, error) {
  661. req, out := c.InputService5TestCaseOperation3Request(input)
  662. err := req.Send()
  663. return out, err
  664. }
  665. const opInputService5TestCaseOperation4 = "OperationName"
  666. // InputService5TestCaseOperation4Request generates a "aws/request.Request" representing the
  667. // client's request for the InputService5TestCaseOperation4 operation. The "output" return
  668. // value can be used to capture response data after the request's "Send" method
  669. // is called.
  670. //
  671. // Creating a request object using this method should be used when you want to inject
  672. // custom logic into the request's lifecycle using a custom handler, or if you want to
  673. // access properties on the request object before or after sending the request. If
  674. // you just want the service response, call the InputService5TestCaseOperation4 method directly
  675. // instead.
  676. //
  677. // Note: You must call the "Send" method on the returned request object in order
  678. // to execute the request.
  679. //
  680. // // Example sending a request using the InputService5TestCaseOperation4Request method.
  681. // req, resp := client.InputService5TestCaseOperation4Request(params)
  682. //
  683. // err := req.Send()
  684. // if err == nil { // resp is now filled
  685. // fmt.Println(resp)
  686. // }
  687. //
  688. func (c *InputService5ProtocolTest) InputService5TestCaseOperation4Request(input *InputService5TestShapeInputShape) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation4Output) {
  689. op := &request.Operation{
  690. Name: opInputService5TestCaseOperation4,
  691. HTTPPath: "/",
  692. }
  693. if input == nil {
  694. input = &InputService5TestShapeInputShape{}
  695. }
  696. req = c.newRequest(op, input, output)
  697. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  698. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  699. output = &InputService5TestShapeInputService5TestCaseOperation4Output{}
  700. req.Data = output
  701. return
  702. }
  703. func (c *InputService5ProtocolTest) InputService5TestCaseOperation4(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation4Output, error) {
  704. req, out := c.InputService5TestCaseOperation4Request(input)
  705. err := req.Send()
  706. return out, err
  707. }
  708. const opInputService5TestCaseOperation5 = "OperationName"
  709. // InputService5TestCaseOperation5Request generates a "aws/request.Request" representing the
  710. // client's request for the InputService5TestCaseOperation5 operation. The "output" return
  711. // value can be used to capture response data after the request's "Send" method
  712. // is called.
  713. //
  714. // Creating a request object using this method should be used when you want to inject
  715. // custom logic into the request's lifecycle using a custom handler, or if you want to
  716. // access properties on the request object before or after sending the request. If
  717. // you just want the service response, call the InputService5TestCaseOperation5 method directly
  718. // instead.
  719. //
  720. // Note: You must call the "Send" method on the returned request object in order
  721. // to execute the request.
  722. //
  723. // // Example sending a request using the InputService5TestCaseOperation5Request method.
  724. // req, resp := client.InputService5TestCaseOperation5Request(params)
  725. //
  726. // err := req.Send()
  727. // if err == nil { // resp is now filled
  728. // fmt.Println(resp)
  729. // }
  730. //
  731. func (c *InputService5ProtocolTest) InputService5TestCaseOperation5Request(input *InputService5TestShapeInputShape) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation5Output) {
  732. op := &request.Operation{
  733. Name: opInputService5TestCaseOperation5,
  734. HTTPPath: "/",
  735. }
  736. if input == nil {
  737. input = &InputService5TestShapeInputShape{}
  738. }
  739. req = c.newRequest(op, input, output)
  740. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  741. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  742. output = &InputService5TestShapeInputService5TestCaseOperation5Output{}
  743. req.Data = output
  744. return
  745. }
  746. func (c *InputService5ProtocolTest) InputService5TestCaseOperation5(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation5Output, error) {
  747. req, out := c.InputService5TestCaseOperation5Request(input)
  748. err := req.Send()
  749. return out, err
  750. }
  751. const opInputService5TestCaseOperation6 = "OperationName"
  752. // InputService5TestCaseOperation6Request generates a "aws/request.Request" representing the
  753. // client's request for the InputService5TestCaseOperation6 operation. The "output" return
  754. // value can be used to capture response data after the request's "Send" method
  755. // is called.
  756. //
  757. // Creating a request object using this method should be used when you want to inject
  758. // custom logic into the request's lifecycle using a custom handler, or if you want to
  759. // access properties on the request object before or after sending the request. If
  760. // you just want the service response, call the InputService5TestCaseOperation6 method directly
  761. // instead.
  762. //
  763. // Note: You must call the "Send" method on the returned request object in order
  764. // to execute the request.
  765. //
  766. // // Example sending a request using the InputService5TestCaseOperation6Request method.
  767. // req, resp := client.InputService5TestCaseOperation6Request(params)
  768. //
  769. // err := req.Send()
  770. // if err == nil { // resp is now filled
  771. // fmt.Println(resp)
  772. // }
  773. //
  774. func (c *InputService5ProtocolTest) InputService5TestCaseOperation6Request(input *InputService5TestShapeInputShape) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation6Output) {
  775. op := &request.Operation{
  776. Name: opInputService5TestCaseOperation6,
  777. HTTPPath: "/",
  778. }
  779. if input == nil {
  780. input = &InputService5TestShapeInputShape{}
  781. }
  782. req = c.newRequest(op, input, output)
  783. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  784. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  785. output = &InputService5TestShapeInputService5TestCaseOperation6Output{}
  786. req.Data = output
  787. return
  788. }
  789. func (c *InputService5ProtocolTest) InputService5TestCaseOperation6(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation6Output, error) {
  790. req, out := c.InputService5TestCaseOperation6Request(input)
  791. err := req.Send()
  792. return out, err
  793. }
  794. type InputService5TestShapeInputService5TestCaseOperation1Output struct {
  795. _ struct{} `type:"structure"`
  796. }
  797. type InputService5TestShapeInputService5TestCaseOperation2Output struct {
  798. _ struct{} `type:"structure"`
  799. }
  800. type InputService5TestShapeInputService5TestCaseOperation3Output struct {
  801. _ struct{} `type:"structure"`
  802. }
  803. type InputService5TestShapeInputService5TestCaseOperation4Output struct {
  804. _ struct{} `type:"structure"`
  805. }
  806. type InputService5TestShapeInputService5TestCaseOperation5Output struct {
  807. _ struct{} `type:"structure"`
  808. }
  809. type InputService5TestShapeInputService5TestCaseOperation6Output struct {
  810. _ struct{} `type:"structure"`
  811. }
  812. type InputService5TestShapeInputShape struct {
  813. _ struct{} `type:"structure"`
  814. RecursiveStruct *InputService5TestShapeRecursiveStructType `type:"structure"`
  815. }
  816. type InputService5TestShapeRecursiveStructType struct {
  817. _ struct{} `type:"structure"`
  818. NoRecurse *string `type:"string"`
  819. RecursiveList []*InputService5TestShapeRecursiveStructType `type:"list"`
  820. RecursiveMap map[string]*InputService5TestShapeRecursiveStructType `type:"map"`
  821. RecursiveStruct *InputService5TestShapeRecursiveStructType `type:"structure"`
  822. }
  823. //The service client's operations are safe to be used concurrently.
  824. // It is not safe to mutate any of the client's properties though.
  825. type InputService6ProtocolTest struct {
  826. *client.Client
  827. }
  828. // New creates a new instance of the InputService6ProtocolTest client with a session.
  829. // If additional configuration is needed for the client instance use the optional
  830. // aws.Config parameter to add your extra config.
  831. //
  832. // Example:
  833. // // Create a InputService6ProtocolTest client from just a session.
  834. // svc := inputservice6protocoltest.New(mySession)
  835. //
  836. // // Create a InputService6ProtocolTest client with additional configuration
  837. // svc := inputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  838. func NewInputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService6ProtocolTest {
  839. c := p.ClientConfig("inputservice6protocoltest", cfgs...)
  840. return newInputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  841. }
  842. // newClient creates, initializes and returns a new service client instance.
  843. func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService6ProtocolTest {
  844. svc := &InputService6ProtocolTest{
  845. Client: client.New(
  846. cfg,
  847. metadata.ClientInfo{
  848. ServiceName: "inputservice6protocoltest",
  849. SigningRegion: signingRegion,
  850. Endpoint: endpoint,
  851. APIVersion: "",
  852. JSONVersion: "1.1",
  853. TargetPrefix: "com.amazonaws.foo",
  854. },
  855. handlers,
  856. ),
  857. }
  858. // Handlers
  859. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  860. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  861. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  862. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  863. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  864. return svc
  865. }
  866. // newRequest creates a new request for a InputService6ProtocolTest operation and runs any
  867. // custom request initialization.
  868. func (c *InputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  869. req := c.NewRequest(op, params, data)
  870. return req
  871. }
  872. const opInputService6TestCaseOperation1 = "OperationName"
  873. // InputService6TestCaseOperation1Request generates a "aws/request.Request" representing the
  874. // client's request for the InputService6TestCaseOperation1 operation. The "output" return
  875. // value can be used to capture response data after the request's "Send" method
  876. // is called.
  877. //
  878. // Creating a request object using this method should be used when you want to inject
  879. // custom logic into the request's lifecycle using a custom handler, or if you want to
  880. // access properties on the request object before or after sending the request. If
  881. // you just want the service response, call the InputService6TestCaseOperation1 method directly
  882. // instead.
  883. //
  884. // Note: You must call the "Send" method on the returned request object in order
  885. // to execute the request.
  886. //
  887. // // Example sending a request using the InputService6TestCaseOperation1Request method.
  888. // req, resp := client.InputService6TestCaseOperation1Request(params)
  889. //
  890. // err := req.Send()
  891. // if err == nil { // resp is now filled
  892. // fmt.Println(resp)
  893. // }
  894. //
  895. func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputService6TestCaseOperation1Input) (req *request.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) {
  896. op := &request.Operation{
  897. Name: opInputService6TestCaseOperation1,
  898. HTTPMethod: "POST",
  899. HTTPPath: "/",
  900. }
  901. if input == nil {
  902. input = &InputService6TestShapeInputService6TestCaseOperation1Input{}
  903. }
  904. req = c.newRequest(op, input, output)
  905. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  906. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  907. output = &InputService6TestShapeInputService6TestCaseOperation1Output{}
  908. req.Data = output
  909. return
  910. }
  911. func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputService6TestCaseOperation1Input) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) {
  912. req, out := c.InputService6TestCaseOperation1Request(input)
  913. err := req.Send()
  914. return out, err
  915. }
  916. type InputService6TestShapeInputService6TestCaseOperation1Input struct {
  917. _ struct{} `type:"structure"`
  918. Map map[string]*string `type:"map"`
  919. }
  920. type InputService6TestShapeInputService6TestCaseOperation1Output struct {
  921. _ struct{} `type:"structure"`
  922. }
  923. //The service client's operations are safe to be used concurrently.
  924. // It is not safe to mutate any of the client's properties though.
  925. type InputService7ProtocolTest struct {
  926. *client.Client
  927. }
  928. // New creates a new instance of the InputService7ProtocolTest client with a session.
  929. // If additional configuration is needed for the client instance use the optional
  930. // aws.Config parameter to add your extra config.
  931. //
  932. // Example:
  933. // // Create a InputService7ProtocolTest client from just a session.
  934. // svc := inputservice7protocoltest.New(mySession)
  935. //
  936. // // Create a InputService7ProtocolTest client with additional configuration
  937. // svc := inputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  938. func NewInputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService7ProtocolTest {
  939. c := p.ClientConfig("inputservice7protocoltest", cfgs...)
  940. return newInputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  941. }
  942. // newClient creates, initializes and returns a new service client instance.
  943. func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService7ProtocolTest {
  944. svc := &InputService7ProtocolTest{
  945. Client: client.New(
  946. cfg,
  947. metadata.ClientInfo{
  948. ServiceName: "inputservice7protocoltest",
  949. SigningRegion: signingRegion,
  950. Endpoint: endpoint,
  951. APIVersion: "2014-01-01",
  952. JSONVersion: "",
  953. TargetPrefix: "",
  954. },
  955. handlers,
  956. ),
  957. }
  958. // Handlers
  959. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  960. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  961. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  962. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  963. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  964. return svc
  965. }
  966. // newRequest creates a new request for a InputService7ProtocolTest operation and runs any
  967. // custom request initialization.
  968. func (c *InputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  969. req := c.NewRequest(op, params, data)
  970. return req
  971. }
  972. const opInputService7TestCaseOperation1 = "OperationName"
  973. // InputService7TestCaseOperation1Request generates a "aws/request.Request" representing the
  974. // client's request for the InputService7TestCaseOperation1 operation. The "output" return
  975. // value can be used to capture response data after the request's "Send" method
  976. // is called.
  977. //
  978. // Creating a request object using this method should be used when you want to inject
  979. // custom logic into the request's lifecycle using a custom handler, or if you want to
  980. // access properties on the request object before or after sending the request. If
  981. // you just want the service response, call the InputService7TestCaseOperation1 method directly
  982. // instead.
  983. //
  984. // Note: You must call the "Send" method on the returned request object in order
  985. // to execute the request.
  986. //
  987. // // Example sending a request using the InputService7TestCaseOperation1Request method.
  988. // req, resp := client.InputService7TestCaseOperation1Request(params)
  989. //
  990. // err := req.Send()
  991. // if err == nil { // resp is now filled
  992. // fmt.Println(resp)
  993. // }
  994. //
  995. func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputShape) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) {
  996. op := &request.Operation{
  997. Name: opInputService7TestCaseOperation1,
  998. HTTPMethod: "POST",
  999. HTTPPath: "/path",
  1000. }
  1001. if input == nil {
  1002. input = &InputService7TestShapeInputShape{}
  1003. }
  1004. req = c.newRequest(op, input, output)
  1005. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1006. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1007. output = &InputService7TestShapeInputService7TestCaseOperation1Output{}
  1008. req.Data = output
  1009. return
  1010. }
  1011. func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputShape) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) {
  1012. req, out := c.InputService7TestCaseOperation1Request(input)
  1013. err := req.Send()
  1014. return out, err
  1015. }
  1016. const opInputService7TestCaseOperation2 = "OperationName"
  1017. // InputService7TestCaseOperation2Request generates a "aws/request.Request" representing the
  1018. // client's request for the InputService7TestCaseOperation2 operation. The "output" return
  1019. // value can be used to capture response data after the request's "Send" method
  1020. // is called.
  1021. //
  1022. // Creating a request object using this method should be used when you want to inject
  1023. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1024. // access properties on the request object before or after sending the request. If
  1025. // you just want the service response, call the InputService7TestCaseOperation2 method directly
  1026. // instead.
  1027. //
  1028. // Note: You must call the "Send" method on the returned request object in order
  1029. // to execute the request.
  1030. //
  1031. // // Example sending a request using the InputService7TestCaseOperation2Request method.
  1032. // req, resp := client.InputService7TestCaseOperation2Request(params)
  1033. //
  1034. // err := req.Send()
  1035. // if err == nil { // resp is now filled
  1036. // fmt.Println(resp)
  1037. // }
  1038. //
  1039. func (c *InputService7ProtocolTest) InputService7TestCaseOperation2Request(input *InputService7TestShapeInputShape) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation2Output) {
  1040. op := &request.Operation{
  1041. Name: opInputService7TestCaseOperation2,
  1042. HTTPMethod: "POST",
  1043. HTTPPath: "/path",
  1044. }
  1045. if input == nil {
  1046. input = &InputService7TestShapeInputShape{}
  1047. }
  1048. req = c.newRequest(op, input, output)
  1049. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1050. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1051. output = &InputService7TestShapeInputService7TestCaseOperation2Output{}
  1052. req.Data = output
  1053. return
  1054. }
  1055. func (c *InputService7ProtocolTest) InputService7TestCaseOperation2(input *InputService7TestShapeInputShape) (*InputService7TestShapeInputService7TestCaseOperation2Output, error) {
  1056. req, out := c.InputService7TestCaseOperation2Request(input)
  1057. err := req.Send()
  1058. return out, err
  1059. }
  1060. type InputService7TestShapeInputService7TestCaseOperation1Output struct {
  1061. _ struct{} `type:"structure"`
  1062. }
  1063. type InputService7TestShapeInputService7TestCaseOperation2Output struct {
  1064. _ struct{} `type:"structure"`
  1065. }
  1066. type InputService7TestShapeInputShape struct {
  1067. _ struct{} `type:"structure"`
  1068. Token *string `type:"string" idempotencyToken:"true"`
  1069. }
  1070. //
  1071. // Tests begin here
  1072. //
  1073. func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) {
  1074. svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1075. input := &InputService1TestShapeInputService1TestCaseOperation1Input{
  1076. Name: aws.String("myname"),
  1077. }
  1078. req, _ := svc.InputService1TestCaseOperation1Request(input)
  1079. r := req.HTTPRequest
  1080. // build request
  1081. jsonrpc.Build(req)
  1082. assert.NoError(t, req.Error)
  1083. // assert body
  1084. assert.NotNil(t, r.Body)
  1085. body, _ := ioutil.ReadAll(r.Body)
  1086. awstesting.AssertJSON(t, `{"Name":"myname"}`, util.Trim(string(body)))
  1087. // assert URL
  1088. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1089. // assert headers
  1090. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1091. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1092. }
  1093. func TestInputService2ProtocolTestTimestampValuesCase1(t *testing.T) {
  1094. svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1095. input := &InputService2TestShapeInputService2TestCaseOperation1Input{
  1096. TimeArg: aws.Time(time.Unix(1422172800, 0)),
  1097. }
  1098. req, _ := svc.InputService2TestCaseOperation1Request(input)
  1099. r := req.HTTPRequest
  1100. // build request
  1101. jsonrpc.Build(req)
  1102. assert.NoError(t, req.Error)
  1103. // assert body
  1104. assert.NotNil(t, r.Body)
  1105. body, _ := ioutil.ReadAll(r.Body)
  1106. awstesting.AssertJSON(t, `{"TimeArg":1422172800}`, util.Trim(string(body)))
  1107. // assert URL
  1108. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1109. // assert headers
  1110. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1111. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1112. }
  1113. func TestInputService3ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
  1114. svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1115. input := &InputService3TestShapeInputShape{
  1116. BlobArg: []byte("foo"),
  1117. }
  1118. req, _ := svc.InputService3TestCaseOperation1Request(input)
  1119. r := req.HTTPRequest
  1120. // build request
  1121. jsonrpc.Build(req)
  1122. assert.NoError(t, req.Error)
  1123. // assert body
  1124. assert.NotNil(t, r.Body)
  1125. body, _ := ioutil.ReadAll(r.Body)
  1126. awstesting.AssertJSON(t, `{"BlobArg":"Zm9v"}`, util.Trim(string(body)))
  1127. // assert URL
  1128. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1129. // assert headers
  1130. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1131. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1132. }
  1133. func TestInputService3ProtocolTestBase64EncodedBlobsCase2(t *testing.T) {
  1134. svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1135. input := &InputService3TestShapeInputShape{
  1136. BlobMap: map[string][]byte{
  1137. "key1": []byte("foo"),
  1138. "key2": []byte("bar"),
  1139. },
  1140. }
  1141. req, _ := svc.InputService3TestCaseOperation2Request(input)
  1142. r := req.HTTPRequest
  1143. // build request
  1144. jsonrpc.Build(req)
  1145. assert.NoError(t, req.Error)
  1146. // assert body
  1147. assert.NotNil(t, r.Body)
  1148. body, _ := ioutil.ReadAll(r.Body)
  1149. awstesting.AssertJSON(t, `{"BlobMap":{"key1":"Zm9v","key2":"YmFy"}}`, util.Trim(string(body)))
  1150. // assert URL
  1151. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1152. // assert headers
  1153. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1154. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1155. }
  1156. func TestInputService4ProtocolTestNestedBlobsCase1(t *testing.T) {
  1157. svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1158. input := &InputService4TestShapeInputService4TestCaseOperation1Input{
  1159. ListParam: [][]byte{
  1160. []byte("foo"),
  1161. []byte("bar"),
  1162. },
  1163. }
  1164. req, _ := svc.InputService4TestCaseOperation1Request(input)
  1165. r := req.HTTPRequest
  1166. // build request
  1167. jsonrpc.Build(req)
  1168. assert.NoError(t, req.Error)
  1169. // assert body
  1170. assert.NotNil(t, r.Body)
  1171. body, _ := ioutil.ReadAll(r.Body)
  1172. awstesting.AssertJSON(t, `{"ListParam":["Zm9v","YmFy"]}`, util.Trim(string(body)))
  1173. // assert URL
  1174. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1175. // assert headers
  1176. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1177. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1178. }
  1179. func TestInputService5ProtocolTestRecursiveShapesCase1(t *testing.T) {
  1180. svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1181. input := &InputService5TestShapeInputShape{
  1182. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1183. NoRecurse: aws.String("foo"),
  1184. },
  1185. }
  1186. req, _ := svc.InputService5TestCaseOperation1Request(input)
  1187. r := req.HTTPRequest
  1188. // build request
  1189. jsonrpc.Build(req)
  1190. assert.NoError(t, req.Error)
  1191. // assert body
  1192. assert.NotNil(t, r.Body)
  1193. body, _ := ioutil.ReadAll(r.Body)
  1194. awstesting.AssertJSON(t, `{"RecursiveStruct":{"NoRecurse":"foo"}}`, util.Trim(string(body)))
  1195. // assert URL
  1196. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1197. // assert headers
  1198. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1199. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1200. }
  1201. func TestInputService5ProtocolTestRecursiveShapesCase2(t *testing.T) {
  1202. svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1203. input := &InputService5TestShapeInputShape{
  1204. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1205. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1206. NoRecurse: aws.String("foo"),
  1207. },
  1208. },
  1209. }
  1210. req, _ := svc.InputService5TestCaseOperation2Request(input)
  1211. r := req.HTTPRequest
  1212. // build request
  1213. jsonrpc.Build(req)
  1214. assert.NoError(t, req.Error)
  1215. // assert body
  1216. assert.NotNil(t, r.Body)
  1217. body, _ := ioutil.ReadAll(r.Body)
  1218. awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveStruct":{"NoRecurse":"foo"}}}`, util.Trim(string(body)))
  1219. // assert URL
  1220. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1221. // assert headers
  1222. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1223. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1224. }
  1225. func TestInputService5ProtocolTestRecursiveShapesCase3(t *testing.T) {
  1226. svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1227. input := &InputService5TestShapeInputShape{
  1228. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1229. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1230. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1231. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1232. NoRecurse: aws.String("foo"),
  1233. },
  1234. },
  1235. },
  1236. },
  1237. }
  1238. req, _ := svc.InputService5TestCaseOperation3Request(input)
  1239. r := req.HTTPRequest
  1240. // build request
  1241. jsonrpc.Build(req)
  1242. assert.NoError(t, req.Error)
  1243. // assert body
  1244. assert.NotNil(t, r.Body)
  1245. body, _ := ioutil.ReadAll(r.Body)
  1246. awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveStruct":{"RecursiveStruct":{"RecursiveStruct":{"NoRecurse":"foo"}}}}}`, util.Trim(string(body)))
  1247. // assert URL
  1248. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1249. // assert headers
  1250. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1251. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1252. }
  1253. func TestInputService5ProtocolTestRecursiveShapesCase4(t *testing.T) {
  1254. svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1255. input := &InputService5TestShapeInputShape{
  1256. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1257. RecursiveList: []*InputService5TestShapeRecursiveStructType{
  1258. {
  1259. NoRecurse: aws.String("foo"),
  1260. },
  1261. {
  1262. NoRecurse: aws.String("bar"),
  1263. },
  1264. },
  1265. },
  1266. }
  1267. req, _ := svc.InputService5TestCaseOperation4Request(input)
  1268. r := req.HTTPRequest
  1269. // build request
  1270. jsonrpc.Build(req)
  1271. assert.NoError(t, req.Error)
  1272. // assert body
  1273. assert.NotNil(t, r.Body)
  1274. body, _ := ioutil.ReadAll(r.Body)
  1275. awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveList":[{"NoRecurse":"foo"},{"NoRecurse":"bar"}]}}`, util.Trim(string(body)))
  1276. // assert URL
  1277. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1278. // assert headers
  1279. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1280. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1281. }
  1282. func TestInputService5ProtocolTestRecursiveShapesCase5(t *testing.T) {
  1283. svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1284. input := &InputService5TestShapeInputShape{
  1285. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1286. RecursiveList: []*InputService5TestShapeRecursiveStructType{
  1287. {
  1288. NoRecurse: aws.String("foo"),
  1289. },
  1290. {
  1291. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1292. NoRecurse: aws.String("bar"),
  1293. },
  1294. },
  1295. },
  1296. },
  1297. }
  1298. req, _ := svc.InputService5TestCaseOperation5Request(input)
  1299. r := req.HTTPRequest
  1300. // build request
  1301. jsonrpc.Build(req)
  1302. assert.NoError(t, req.Error)
  1303. // assert body
  1304. assert.NotNil(t, r.Body)
  1305. body, _ := ioutil.ReadAll(r.Body)
  1306. awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveList":[{"NoRecurse":"foo"},{"RecursiveStruct":{"NoRecurse":"bar"}}]}}`, util.Trim(string(body)))
  1307. // assert URL
  1308. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1309. // assert headers
  1310. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1311. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1312. }
  1313. func TestInputService5ProtocolTestRecursiveShapesCase6(t *testing.T) {
  1314. svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1315. input := &InputService5TestShapeInputShape{
  1316. RecursiveStruct: &InputService5TestShapeRecursiveStructType{
  1317. RecursiveMap: map[string]*InputService5TestShapeRecursiveStructType{
  1318. "bar": {
  1319. NoRecurse: aws.String("bar"),
  1320. },
  1321. "foo": {
  1322. NoRecurse: aws.String("foo"),
  1323. },
  1324. },
  1325. },
  1326. }
  1327. req, _ := svc.InputService5TestCaseOperation6Request(input)
  1328. r := req.HTTPRequest
  1329. // build request
  1330. jsonrpc.Build(req)
  1331. assert.NoError(t, req.Error)
  1332. // assert body
  1333. assert.NotNil(t, r.Body)
  1334. body, _ := ioutil.ReadAll(r.Body)
  1335. awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveMap":{"foo":{"NoRecurse":"foo"},"bar":{"NoRecurse":"bar"}}}}`, util.Trim(string(body)))
  1336. // assert URL
  1337. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1338. // assert headers
  1339. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1340. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1341. }
  1342. func TestInputService6ProtocolTestEmptyMapsCase1(t *testing.T) {
  1343. svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1344. input := &InputService6TestShapeInputService6TestCaseOperation1Input{
  1345. Map: map[string]*string{},
  1346. }
  1347. req, _ := svc.InputService6TestCaseOperation1Request(input)
  1348. r := req.HTTPRequest
  1349. // build request
  1350. jsonrpc.Build(req)
  1351. assert.NoError(t, req.Error)
  1352. // assert body
  1353. assert.NotNil(t, r.Body)
  1354. body, _ := ioutil.ReadAll(r.Body)
  1355. awstesting.AssertJSON(t, `{"Map":{}}`, util.Trim(string(body)))
  1356. // assert URL
  1357. awstesting.AssertURL(t, "https://test/", r.URL.String())
  1358. // assert headers
  1359. assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type"))
  1360. assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target"))
  1361. }
  1362. func TestInputService7ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) {
  1363. svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1364. input := &InputService7TestShapeInputShape{
  1365. Token: aws.String("abc123"),
  1366. }
  1367. req, _ := svc.InputService7TestCaseOperation1Request(input)
  1368. r := req.HTTPRequest
  1369. // build request
  1370. jsonrpc.Build(req)
  1371. assert.NoError(t, req.Error)
  1372. // assert body
  1373. assert.NotNil(t, r.Body)
  1374. body, _ := ioutil.ReadAll(r.Body)
  1375. awstesting.AssertJSON(t, `{"Token":"abc123"}`, util.Trim(string(body)))
  1376. // assert URL
  1377. awstesting.AssertURL(t, "https://test/path", r.URL.String())
  1378. // assert headers
  1379. }
  1380. func TestInputService7ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) {
  1381. svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
  1382. input := &InputService7TestShapeInputShape{}
  1383. req, _ := svc.InputService7TestCaseOperation2Request(input)
  1384. r := req.HTTPRequest
  1385. // build request
  1386. jsonrpc.Build(req)
  1387. assert.NoError(t, req.Error)
  1388. // assert body
  1389. assert.NotNil(t, r.Body)
  1390. body, _ := ioutil.ReadAll(r.Body)
  1391. awstesting.AssertJSON(t, `{"Token":"00000000-0000-4000-8000-000000000000"}`, util.Trim(string(body)))
  1392. // assert URL
  1393. awstesting.AssertURL(t, "https://test/path", r.URL.String())
  1394. // assert headers
  1395. }