MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / criteria

Method criteria

examples/dynamodb/main.cpp:33–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32struct criteria {
33 criteria(Aws::Utils::Json::JsonView data) : error_msg(nullptr)
34 {
35 using namespace Aws::Utils;
36 auto path_params = data.GetObject("pathParameters");
37 if (!path_params.ValueExists("productId")) {
38 error_msg = "Missing URL parameter {productId}.";
39 return;
40 }
41
42 product_id = path_params.GetString("productId");
43 auto qs = data.GetObject("queryStringParameters");
44
45 if (!qs.ValueExists("startDate")) {
46 error_msg = "Missing query string parameter 'startDate'.";
47 return;
48 }
49 start_date = DateTime(qs.GetString("startDate"), DateFormat::ISO_8601);
50 if (!start_date.WasParseSuccessful()) {
51 error_msg = "Invalid input format. startDate must be in ISO 8601 format.";
52 return;
53 }
54
55 if (!qs.ValueExists("endDate")) {
56 error_msg = "Missing query string parameter 'endDate'.";
57 return;
58 }
59 end_date = DateTime(qs.GetString("endDate"), DateFormat::ISO_8601);
60 if (!end_date.WasParseSuccessful()) {
61 error_msg = "Invalid input format. endDate must be in ISO 8601 format.";
62 return;
63 }
64 }
65
66 std::string product_id;
67 Aws::Utils::DateTime start_date;

Callers

nothing calls this directly

Calls 1

GetStringMethod · 0.80

Tested by

no test coverage detected