lib: service: api: Multi-payload generation

Paygen can create multiple payloads for a paygen request depending on
the type of requested payload. This requires the return from paygen and
build downstreams to pick up the changes.

The new run (generation) of PaygenPayload accounts for a payload type
requiring multiple payloads to be generated and updates the API to
return a dict mapping key version to local path and remote URI.

e.g.
  {
    1: ("<local_path", "<remote_uri>"),
    2: ("<local_path", "<remote_uri>"),
    ...
    N: ("<local_path", "<remote_uri>"),
  }

The return type here accounts for potential future key additions as
well.

BUG=b:267545513
TEST=./run_tests
TEST=local paygen

Change-Id: I016b90cb5a4814e46e4bf20a98a642d9a09db62e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4237942
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/api/controller/payload_unittest.py b/api/controller/payload_unittest.py
index 6f4c85c..5bfb482 100644
--- a/api/controller/payload_unittest.py
+++ b/api/controller/payload_unittest.py
@@ -83,7 +83,9 @@
         """Check that a call is made successfully."""
         # Deep patch the paygen lib, this is a full run through service as well.
         patch_obj = self.PatchObject(paygen_payload_lib, "PaygenPayload")
-        patch_obj.return_value.Run.return_value = "gs://something"
+        patch_obj.return_value.Run.return_value = {
+            1: ("/local/foo", "gs://something")
+        }
         res = payload.GeneratePayload(self.req, self.result, self.api_config)
         self.assertEqual(res, controller.RETURN_CODE_SUCCESS)
 
@@ -110,7 +112,9 @@
     def testMiniOSSuccess(self):
         """Test a miniOS paygen request."""
         patch = self.PatchObject(paygen_payload_lib, "PaygenPayload")
-        patch.return_value.Run.return_value = "gs://minios/something"
+        patch.return_value.Run.return_value = {
+            1: ("/local/foo", "gs://minios/something")
+        }
         res = payload.GeneratePayload(
             self.minios_req, self.result, self.api_config
         )