my_api_client 0.14.0.pre → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +179 -38
  3. data/.dependabot/config.yml +19 -1
  4. data/.envrc.skeleton +1 -0
  5. data/.rubocop.yml +9 -1
  6. data/.rubocop_challenge.yml +5 -0
  7. data/.rubocop_todo.yml +29 -1
  8. data/CHANGELOG.md +177 -1
  9. data/Gemfile.lock +47 -45
  10. data/README.jp.md +156 -21
  11. data/bin/console +4 -0
  12. data/example/api_clients/application_api_client.rb +13 -0
  13. data/example/api_clients/my_error_api_client.rb +34 -0
  14. data/example/api_clients/my_errors.rb +27 -0
  15. data/example/api_clients/my_pagination_api_client.rb +18 -0
  16. data/example/api_clients/my_rest_api_client.rb +48 -0
  17. data/example/api_clients/my_status_api_client.rb +22 -0
  18. data/lib/generators/rails/templates/application_api_client.rb.erb +0 -11
  19. data/lib/generators/rspec/templates/api_client_spec.rb.erb +22 -15
  20. data/lib/my_api_client.rb +7 -0
  21. data/lib/my_api_client/base.rb +4 -2
  22. data/lib/my_api_client/default_error_handlers.rb +64 -0
  23. data/lib/my_api_client/error_handling.rb +6 -6
  24. data/lib/my_api_client/error_handling/generator.rb +23 -7
  25. data/lib/my_api_client/errors.rb +1 -53
  26. data/lib/my_api_client/errors/api_limit_error.rb +6 -0
  27. data/lib/my_api_client/errors/client_error.rb +93 -0
  28. data/lib/my_api_client/errors/network_error.rb +43 -0
  29. data/lib/my_api_client/errors/server_error.rb +42 -0
  30. data/lib/my_api_client/request.rb +29 -34
  31. data/lib/my_api_client/request/basic.rb +32 -0
  32. data/lib/my_api_client/request/executor.rb +1 -1
  33. data/lib/my_api_client/request/pagination.rb +39 -0
  34. data/lib/my_api_client/rspec/matchers/request_to.rb +3 -4
  35. data/lib/my_api_client/version.rb +1 -1
  36. data/my_api/.envrc.skeleton +3 -0
  37. data/my_api/.gitignore +14 -0
  38. data/my_api/.jetskeep +1 -0
  39. data/my_api/.rspec +3 -0
  40. data/my_api/.ruby-version +1 -0
  41. data/my_api/Gemfile +23 -0
  42. data/my_api/Gemfile.lock +243 -0
  43. data/my_api/Procfile +7 -0
  44. data/my_api/README.md +54 -0
  45. data/my_api/Rakefile +4 -0
  46. data/my_api/app/controllers/application_controller.rb +5 -0
  47. data/my_api/app/controllers/error_controller.rb +21 -0
  48. data/my_api/app/controllers/pagination_controller.rb +58 -0
  49. data/my_api/app/controllers/rest_controller.rb +60 -0
  50. data/my_api/app/controllers/status_controller.rb +11 -0
  51. data/my_api/app/helpers/application_helper.rb +5 -0
  52. data/my_api/app/jobs/application_job.rb +7 -0
  53. data/my_api/app/models/application_item.rb +5 -0
  54. data/my_api/config.ru +7 -0
  55. data/my_api/config/application.rb +73 -0
  56. data/my_api/config/dynamodb.yml +22 -0
  57. data/my_api/config/environments/development.rb +9 -0
  58. data/my_api/config/environments/production.rb +11 -0
  59. data/my_api/config/environments/test.rb +9 -0
  60. data/my_api/config/routes.rb +17 -0
  61. data/my_api/db/.gitkeep +0 -0
  62. data/my_api/public/404.html +67 -0
  63. data/my_api/public/422.html +67 -0
  64. data/my_api/public/500.html +66 -0
  65. data/my_api/public/favicon.ico +0 -0
  66. data/my_api/public/index.html +91 -0
  67. data/my_api/spec/controllers/error_controller_spec.rb +43 -0
  68. data/my_api/spec/controllers/pagination_controller_spec.rb +73 -0
  69. data/my_api/spec/controllers/rest_controller_spec.rb +99 -0
  70. data/my_api/spec/controllers/status_controller_spec.rb +47 -0
  71. data/my_api/spec/fixtures/payloads/posts-index.json +51 -0
  72. data/my_api/spec/fixtures/payloads/posts-show.json +53 -0
  73. data/my_api/spec/spec_helper.rb +31 -0
  74. data/rails_app/rails_5.2/.rspec +3 -0
  75. data/rails_app/rails_5.2/Gemfile +18 -0
  76. data/rails_app/rails_5.2/Gemfile.lock +171 -0
  77. data/rails_app/rails_5.2/README.md +24 -0
  78. data/rails_app/rails_5.2/Rakefile +8 -0
  79. data/rails_app/rails_5.2/app/controllers/application_controller.rb +4 -0
  80. data/rails_app/rails_5.2/app/jobs/application_job.rb +4 -0
  81. data/rails_app/rails_5.2/bin/bundle +5 -0
  82. data/rails_app/rails_5.2/bin/rails +6 -0
  83. data/rails_app/rails_5.2/bin/rake +6 -0
  84. data/rails_app/rails_5.2/bin/setup +27 -0
  85. data/rails_app/rails_5.2/bin/update +27 -0
  86. data/rails_app/rails_5.2/config.ru +7 -0
  87. data/rails_app/rails_5.2/config/application.rb +37 -0
  88. data/rails_app/rails_5.2/config/boot.rb +6 -0
  89. data/rails_app/rails_5.2/config/credentials.yml.enc +1 -0
  90. data/rails_app/rails_5.2/config/environment.rb +7 -0
  91. data/rails_app/rails_5.2/config/environments/development.rb +41 -0
  92. data/rails_app/rails_5.2/config/environments/production.rb +70 -0
  93. data/rails_app/rails_5.2/config/environments/test.rb +38 -0
  94. data/rails_app/rails_5.2/config/initializers/application_controller_renderer.rb +9 -0
  95. data/rails_app/rails_5.2/config/initializers/backtrace_silencers.rb +8 -0
  96. data/rails_app/rails_5.2/config/initializers/cors.rb +17 -0
  97. data/rails_app/rails_5.2/config/initializers/filter_parameter_logging.rb +6 -0
  98. data/rails_app/rails_5.2/config/initializers/inflections.rb +17 -0
  99. data/rails_app/rails_5.2/config/initializers/mime_types.rb +5 -0
  100. data/rails_app/rails_5.2/config/initializers/wrap_parameters.rb +11 -0
  101. data/rails_app/rails_5.2/config/locales/en.yml +33 -0
  102. data/rails_app/rails_5.2/config/routes.rb +5 -0
  103. data/rails_app/rails_5.2/config/spring.rb +8 -0
  104. data/rails_app/rails_5.2/public/robots.txt +1 -0
  105. data/rails_app/rails_5.2/spec/rails_helper.rb +14 -0
  106. data/rails_app/rails_5.2/spec/spec_helper.rb +13 -0
  107. data/rails_app/rails_6.0/.rspec +3 -0
  108. data/rails_app/rails_6.0/Gemfile +17 -0
  109. data/rails_app/rails_6.0/Gemfile.lock +186 -0
  110. data/rails_app/rails_6.0/README.md +24 -0
  111. data/rails_app/rails_6.0/Rakefile +8 -0
  112. data/rails_app/rails_6.0/app/controllers/application_controller.rb +4 -0
  113. data/rails_app/rails_6.0/app/jobs/application_job.rb +9 -0
  114. data/rails_app/rails_6.0/bin/rails +6 -0
  115. data/rails_app/rails_6.0/bin/rake +6 -0
  116. data/rails_app/rails_6.0/bin/setup +27 -0
  117. data/rails_app/rails_6.0/config.ru +7 -0
  118. data/rails_app/rails_6.0/config/application.rb +39 -0
  119. data/rails_app/rails_6.0/config/boot.rb +6 -0
  120. data/rails_app/rails_6.0/config/credentials.yml.enc +1 -0
  121. data/rails_app/rails_6.0/config/environment.rb +7 -0
  122. data/rails_app/rails_6.0/config/environments/development.rb +39 -0
  123. data/rails_app/rails_6.0/config/environments/production.rb +90 -0
  124. data/rails_app/rails_6.0/config/environments/test.rb +41 -0
  125. data/rails_app/rails_6.0/config/initializers/application_controller_renderer.rb +9 -0
  126. data/rails_app/rails_6.0/config/initializers/backtrace_silencers.rb +8 -0
  127. data/rails_app/rails_6.0/config/initializers/cors.rb +17 -0
  128. data/rails_app/rails_6.0/config/initializers/filter_parameter_logging.rb +6 -0
  129. data/rails_app/rails_6.0/config/initializers/inflections.rb +17 -0
  130. data/rails_app/rails_6.0/config/initializers/mime_types.rb +5 -0
  131. data/rails_app/rails_6.0/config/initializers/wrap_parameters.rb +11 -0
  132. data/rails_app/rails_6.0/config/locales/en.yml +33 -0
  133. data/rails_app/rails_6.0/config/routes.rb +5 -0
  134. data/rails_app/rails_6.0/config/spring.rb +8 -0
  135. data/rails_app/rails_6.0/public/robots.txt +1 -0
  136. data/rails_app/rails_6.0/spec/rails_helper.rb +14 -0
  137. data/rails_app/rails_6.0/spec/spec_helper.rb +13 -0
  138. metadata +120 -5
  139. data/renovate.json +0 -21
Binary file
@@ -0,0 +1,91 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Ruby on Jets</title>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width">
7
+ <style type="text/css" media="screen" charset="utf-8">
8
+ body {
9
+ text-align: center;
10
+ margin: 0;
11
+ }
12
+ img {
13
+ max-width: 320px;
14
+ }
15
+ .container {
16
+ max-width: 648px;
17
+ }
18
+ @media (min-width: 768px) {
19
+ img {
20
+ max-width: none;
21
+ }
22
+ .container {
23
+ max-width: none;
24
+ }
25
+ }
26
+
27
+ .header {
28
+ padding: 20px;
29
+ /*background-color: #b81513;*/
30
+ /*color: white;*/
31
+ }
32
+ .title {
33
+ font-size: 1.5em;
34
+ }
35
+ @media (max-width: 500px) {
36
+ .title {
37
+ font-size: 1.3em;
38
+ }
39
+ }
40
+ .intro {
41
+ text-align: left;
42
+ font-size: large;
43
+ margin: 0 auto;
44
+ padding: 0 20px;
45
+ max-width: 640px;
46
+ }
47
+ pre, code {
48
+ padding: 0;
49
+ margin: 0;
50
+ }
51
+ pre {
52
+ margin-left: 20px;
53
+ width: 99%;
54
+ overflow: auto;
55
+ }
56
+ @media (max-width: 500px) {
57
+ pre {
58
+ margin-left: -30px;
59
+ font-size: 0.8em;
60
+ }
61
+ }
62
+ </style>
63
+ </head>
64
+
65
+ <body>
66
+ <div class="container">
67
+ <header class="header">
68
+ <img src="https://s3.amazonaws.com/jets-public/jets/images/jets.png" class="logo" alt="logo" />
69
+ <h1 class="title">Welcome and congrats!<br /> Jets is running.</h1>
70
+ </header>
71
+ <div class="intro">
72
+ <p>
73
+ To get started:
74
+ </p>
75
+ <div class="code"><pre><code>
76
+ $ jets generate scaffold post title:string
77
+ $ jets db:create db:migrate
78
+ $ jets server
79
+ $ open http://localhost:8888/posts
80
+ $ jets help
81
+ </code></pre></div>
82
+ <p>More on info: <a href="http://rubyonjets.com">rubyonjets.com</a></p>
83
+ <p>Also check out the <a href="http://rubyonjets.com/reference">Jets CLI reference</a>.</p>
84
+ </div>
85
+ <p class="version">
86
+ <strong>Jets version:</strong> 2.3.13<br />
87
+ <strong>Ruby version:</strong> 2.5.3
88
+ </p>
89
+ </div>
90
+ </body>
91
+ </html>
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe ErrorController, type: :controller do
4
+ describe '#show' do
5
+ context 'when request error code 10' do
6
+ let(:code) { 10 }
7
+
8
+ let(:expected_response) do
9
+ {
10
+ error: {
11
+ code: code,
12
+ message: 'You requested error code: 10',
13
+ },
14
+ }.to_json
15
+ end
16
+
17
+ it 'returns 400 Bad request with error code 10' do
18
+ get '/error/:code', code: code
19
+ expect(response.status).to eq 400
20
+ expect(response.body).to eq expected_response
21
+ end
22
+ end
23
+
24
+ context 'when request error code 20' do
25
+ let(:code) { 20 }
26
+
27
+ let(:expected_response) do
28
+ {
29
+ error: {
30
+ code: code,
31
+ message: 'You requested error code: 20',
32
+ },
33
+ }.to_json
34
+ end
35
+
36
+ it 'returns 400 Bad request with error code 20' do
37
+ get '/error/:code', code: code
38
+ expect(response.status).to eq 400
39
+ expect(response.body).to eq expected_response
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe PaginationController, type: :controller do
4
+ describe '#index' do
5
+ let(:first_page) do
6
+ {
7
+ links: {
8
+ next: 'https://example.com/test/pagination?page=2',
9
+ },
10
+ page: 1,
11
+ }.to_json
12
+ end
13
+
14
+ let(:second_page) do
15
+ {
16
+ links: {
17
+ next: 'https://example.com/test/pagination?page=3',
18
+ previous: 'https://example.com/test/pagination?page=1',
19
+ },
20
+ page: 2,
21
+ }.to_json
22
+ end
23
+
24
+ let(:third_page) do
25
+ {
26
+ links: {
27
+ previous: 'https://example.com/test/pagination?page=2',
28
+ },
29
+ page: 3,
30
+ }.to_json
31
+ end
32
+
33
+ context 'without page' do
34
+ it 'returns a 1st page contents including 2nd page link' do
35
+ get '/pagination'
36
+ expect(response.status).to eq 200
37
+ expect(response.body).to eq first_page
38
+ end
39
+ end
40
+
41
+ context 'with page = 1' do
42
+ it 'returns a 1st page contents including 2nd page link' do
43
+ get '/pagination', page: 1
44
+ expect(response.status).to eq 200
45
+ expect(response.body).to eq first_page
46
+ end
47
+ end
48
+
49
+ context 'with page = 2' do
50
+ it 'returns a 2nd page contents including 3rd page link' do
51
+ get '/pagination', page: 2
52
+ expect(response.status).to eq 200
53
+ expect(response.body).to eq second_page
54
+ end
55
+ end
56
+
57
+ context 'with page = 3' do
58
+ it 'returns a 3rd page contents not including next page link' do
59
+ get '/pagination', page: 3
60
+ expect(response.status).to eq 200
61
+ expect(response.body).to eq third_page
62
+ end
63
+ end
64
+
65
+ context 'with page = 4' do
66
+ it 'returns 404 NOT FOUND' do
67
+ get '/pagination', page: 4
68
+ expect(response.status).to eq 404
69
+ expect(response.body).to be_blank
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe RestController, type: :controller do
4
+ describe '#index' do
5
+ context 'with order = asc' do
6
+ let(:array_of_posts) do
7
+ [
8
+ { id: 1, title: 'Title 1' },
9
+ { id: 2, title: 'Title 2' },
10
+ { id: 3, title: 'Title 3' },
11
+ ].to_json
12
+ end
13
+
14
+ it 'returns an array of posts ordered by id' do
15
+ get '/rest', order: 'asc'
16
+ expect(response.status).to eq 200
17
+ expect(response.body).to eq array_of_posts
18
+ end
19
+ end
20
+
21
+ context 'with order = desc' do
22
+ let(:array_of_posts) do
23
+ [
24
+ { id: 3, title: 'Title 3' },
25
+ { id: 2, title: 'Title 2' },
26
+ { id: 1, title: 'Title 1' },
27
+ ].to_json
28
+ end
29
+
30
+ it 'returns an array of posts reverse ordered by id' do
31
+ get '/rest', order: 'desc'
32
+ expect(response.status).to eq 200
33
+ expect(response.body).to eq array_of_posts
34
+ end
35
+ end
36
+ end
37
+
38
+ describe '#show' do
39
+ let(:post) do
40
+ { id: 1, title: 'Title 1' }.to_json
41
+ end
42
+
43
+ it 'returns a post' do
44
+ get '/rest/:id', id: 1
45
+ expect(response.status).to eq 200
46
+ expect(response.body).to eq post
47
+ end
48
+ end
49
+
50
+ describe '#create' do
51
+ let(:new_post) do
52
+ { id: 4, title: 'New title' }.to_json
53
+ end
54
+
55
+ it 'returns a created post' do
56
+ post '/rest', title: 'New title'
57
+ expect(response.status).to eq 201
58
+ expect(response.body).to eq new_post
59
+ end
60
+ end
61
+
62
+ describe '#update' do
63
+ let(:the_post) do
64
+ { id: 1, title: 'Modified title' }.to_json
65
+ end
66
+
67
+ context 'with POST method' do
68
+ it 'returns a updated post' do
69
+ post '/rest/:id', id: 1, title: 'Modified title'
70
+ expect(response.status).to eq 200
71
+ expect(response.body).to eq the_post
72
+ end
73
+ end
74
+
75
+ context 'with PUT method' do
76
+ it 'returns a updated post' do
77
+ put '/rest/:id', id: 1, title: 'Modified title'
78
+ expect(response.status).to eq 200
79
+ expect(response.body).to eq the_post
80
+ end
81
+ end
82
+
83
+ context 'with PATCH method' do
84
+ it 'returns a updated post' do
85
+ patch '/rest/:id', id: 1, title: 'Modified title'
86
+ expect(response.status).to eq 200
87
+ expect(response.body).to eq the_post
88
+ end
89
+ end
90
+ end
91
+
92
+ describe '#delete' do
93
+ it 'returns no body' do
94
+ delete '/rest/:id', id: 123
95
+ expect(response.status).to eq 204
96
+ expect(response.body).to be_empty
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe StatusController, type: :controller do
4
+ describe '#show' do
5
+ context 'when request status code 200' do
6
+ let(:status) { 200 }
7
+
8
+ let(:expected_response) do
9
+ { message: 'You requested status code: 200' }.to_json
10
+ end
11
+
12
+ it 'returns 200 OK' do
13
+ get '/status/:status', status: status
14
+ expect(response.status).to eq status
15
+ expect(response.body).to eq expected_response
16
+ end
17
+ end
18
+
19
+ context 'when request status code 400' do
20
+ let(:status) { 400 }
21
+
22
+ let(:expected_response) do
23
+ { message: 'You requested status code: 400' }.to_json
24
+ end
25
+
26
+ it 'returns 400 Bad request' do
27
+ get '/status/:status', status: status
28
+ expect(response.status).to eq status
29
+ expect(response.body).to eq expected_response
30
+ end
31
+ end
32
+
33
+ context 'when request status code 500' do
34
+ let(:status) { 500 }
35
+
36
+ let(:expected_response) do
37
+ { message: 'You requested status code: 500' }.to_json
38
+ end
39
+
40
+ it 'returns 500 Internal server error' do
41
+ get '/status/:status', status: status
42
+ expect(response.status).to eq status
43
+ expect(response.body).to eq expected_response
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,51 @@
1
+ {
2
+ "resource": "/posts",
3
+ "path": "/posts",
4
+ "httpMethod": "GET",
5
+ "headers": {
6
+ "Accept": "*/*",
7
+ "CloudFront-Forwarded-Proto": "https",
8
+ "CloudFront-Is-Desktop-Viewer": "true",
9
+ "CloudFront-Is-Mobile-Viewer": "false",
10
+ "CloudFront-Is-SmartTV-Viewer": "false",
11
+ "CloudFront-Is-Tablet-Viewer": "false",
12
+ "CloudFront-Viewer-Country": "US",
13
+ "Host": "qg45s7uvg2.execute-api.us-east-1.amazonaws.com",
14
+ "User-Agent": "curl/7.54.0",
15
+ "Via": "1.1 3d3d633d266d05d90a4eea7a6a59b514.cloudfront.net (CloudFront)",
16
+ "X-Amz-Cf-Id": "4mAgowukJJbA7lgTWITzgOPmdiDsXPCwy6vonS8VKPXCdEsmldVgdg==",
17
+ "X-Amzn-Trace-Id": "Root=1-59fb8ea5-38c5ad176dac130f3eb9ce97",
18
+ "X-Forwarded-For": "69.42.1.180, 54.239.203.118",
19
+ "X-Forwarded-Port": "443",
20
+ "X-Forwarded-Proto": "https"
21
+ },
22
+ "queryStringParameters": null,
23
+ "pathParameters": null,
24
+ "stageVariables": null,
25
+ "requestContext": {
26
+ "path": "/prod/posts",
27
+ "accountId": "123456789012",
28
+ "resourceId": "ery965",
29
+ "stage": "prod",
30
+ "requestId": "292fbcc8-c015-11e7-94fa-cd109b693f3c",
31
+ "identity": {
32
+ "cognitoIdentityPoolId": null,
33
+ "accountId": null,
34
+ "cognitoIdentityId": null,
35
+ "caller": null,
36
+ "apiKey": "",
37
+ "sourceIp": "69.42.1.180",
38
+ "accessKey": null,
39
+ "cognitoAuthenticationType": null,
40
+ "cognitoAuthenticationProvider": null,
41
+ "userArn": null,
42
+ "userAgent": "curl/7.54.0",
43
+ "user": null
44
+ },
45
+ "resourcePath": "/posts",
46
+ "httpMethod": "GET",
47
+ "apiId": "qg45s7uvg2"
48
+ },
49
+ "body": null,
50
+ "isBase64Encoded": false
51
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "resource": "/posts/{id}",
3
+ "path": "/posts/tung",
4
+ "httpMethod": "GET",
5
+ "headers": {
6
+ "Accept": "*/*",
7
+ "CloudFront-Forwarded-Proto": "https",
8
+ "CloudFront-Is-Desktop-Viewer": "true",
9
+ "CloudFront-Is-Mobile-Viewer": "false",
10
+ "CloudFront-Is-SmartTV-Viewer": "false",
11
+ "CloudFront-Is-Tablet-Viewer": "false",
12
+ "CloudFront-Viewer-Country": "US",
13
+ "Host": "qg45s7uvg2.execute-api.us-east-1.amazonaws.com",
14
+ "User-Agent": "curl/7.54.0",
15
+ "Via": "1.1 dc553909528b8b63475c922dc07d8ba6.cloudfront.net (CloudFront)",
16
+ "X-Amz-Cf-Id": "s9NB2f_Z1scd6ksA4fcXA2r4QhpSKQ6QcTLQHGfxDPfI-X7sXM3YLg==",
17
+ "X-Amzn-Trace-Id": "Root=1-59fb8ecb-586ab81d73e36910793d767c",
18
+ "X-Forwarded-For": "69.42.1.180, 54.239.203.97",
19
+ "X-Forwarded-Port": "443",
20
+ "X-Forwarded-Proto": "https"
21
+ },
22
+ "queryStringParameters": null,
23
+ "pathParameters": {
24
+ "id": "tung"
25
+ },
26
+ "stageVariables": null,
27
+ "requestContext": {
28
+ "path": "/prod/posts/tung",
29
+ "accountId": "123456789012",
30
+ "resourceId": "wf2gvu",
31
+ "stage": "prod",
32
+ "requestId": "3feafb4e-c015-11e7-85c9-194f38f4c414",
33
+ "identity": {
34
+ "cognitoIdentityPoolId": null,
35
+ "accountId": null,
36
+ "cognitoIdentityId": null,
37
+ "caller": null,
38
+ "apiKey": "",
39
+ "sourceIp": "69.42.1.180",
40
+ "accessKey": null,
41
+ "cognitoAuthenticationType": null,
42
+ "cognitoAuthenticationProvider": null,
43
+ "userArn": null,
44
+ "userAgent": "curl/7.54.0",
45
+ "user": null
46
+ },
47
+ "resourcePath": "/posts/{id}",
48
+ "httpMethod": "GET",
49
+ "apiId": "qg45s7uvg2"
50
+ },
51
+ "body": null,
52
+ "isBase64Encoded": false
53
+ }