re-enable demo code

This commit is contained in:
Emil Lerch 2023-08-30 13:49:29 -07:00
parent d82728602b
commit fb34e556f7
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -187,31 +187,30 @@ pub fn main() anyerror!void {
const call = try client.call(services.lambda.list_functions.Request{}, options); const call = try client.call(services.lambda.list_functions.Request{}, options);
defer call.deinit(); defer call.deinit();
std.log.info("list request id: {s}", .{call.response_metadata.request_id}); std.log.info("list request id: {s}", .{call.response_metadata.request_id});
std.log.err("Double encoding issue prevents test from completing - skipping test", .{}); if (call.response.functions) |fns| {
// if (call.response.functions) |fns| { if (fns.len > 0) {
// if (fns.len > 0) { const func = fns[0];
// const func = fns[0]; const arn = func.function_arn.?;
// const arn = func.function_arn.?; // This is a bit ugly. Maybe a helper function in the library would help?
// // This is a bit ugly. Maybe a helper function in the library would help? var tags = try std.ArrayList(@typeInfo(try typeForField(services.lambda.tag_resource.Request, "tags")).Pointer.child).initCapacity(allocator, 1);
// var tags = try std.ArrayList(@typeInfo(try typeForField(services.lambda.tag_resource.Request, "tags")).Pointer.child).initCapacity(allocator, 1); defer tags.deinit();
// defer tags.deinit(); tags.appendAssumeCapacity(.{ .key = "Foo", .value = "Bar" });
// tags.appendAssumeCapacity(.{ .key = "Foo", .value = "Bar" }); const req = services.lambda.tag_resource.Request{ .resource = arn, .tags = tags.items };
// const req = services.lambda.tag_resource.Request{ .resource = arn, .tags = tags.items }; const addtag = try aws.Request(services.lambda.tag_resource).call(req, options);
// const addtag = try aws.Request(services.lambda.tag_resource).call(req, options); // TODO: This is failing due to double-encoding (see zig issue 17015)
// // TODO: This is failing due to double-encoding (see zig issue 17015) defer addtag.deinit();
// defer addtag.deinit(); // const addtag = try client.call(services.lambda.tag_resource.Request{ .resource = arn, .tags = &.{.{ .key = "Foo", .value = "Bar" }} }, options);
// // const addtag = try client.call(services.lambda.tag_resource.Request{ .resource = arn, .tags = &.{.{ .key = "Foo", .value = "Bar" }} }, options); std.log.info("add tag request id: {s}", .{addtag.response_metadata.request_id});
// std.log.info("add tag request id: {s}", .{addtag.response_metadata.request_id}); var keys = [_][]const u8{"Foo"}; // Would love to have a way to express this without burning a var here
// var keys = [_][]const u8{"Foo"}; // Would love to have a way to express this without burning a var here const deletetag = try aws.Request(services.lambda.untag_resource).call(.{ .tag_keys = keys[0..], .resource = arn }, options);
// const deletetag = try aws.Request(services.lambda.untag_resource).call(.{ .tag_keys = keys[0..], .resource = arn }, options); defer deletetag.deinit();
// defer deletetag.deinit(); std.log.info("delete tag request id: {s}", .{deletetag.response_metadata.request_id});
// std.log.info("delete tag request id: {s}", .{deletetag.response_metadata.request_id}); } else {
// } else { std.log.err("no functions to work with", .{});
// std.log.err("no functions to work with", .{}); }
// } } else {
// } else { std.log.err("no functions to work with", .{});
// std.log.err("no functions to work with", .{}); }
// }
}, },
.ec2_query_no_input => { .ec2_query_no_input => {
// Describe regions is a simpler request and easier to debug // Describe regions is a simpler request and easier to debug