aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-service-data.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'mod/mod-ci-github-service-data.hxx')
-rw-r--r--mod/mod-ci-github-service-data.hxx25
1 files changed, 17 insertions, 8 deletions
diff --git a/mod/mod-ci-github-service-data.hxx b/mod/mod-ci-github-service-data.hxx
index 93a8895..50bb49d 100644
--- a/mod/mod-ci-github-service-data.hxx
+++ b/mod/mod-ci-github-service-data.hxx
@@ -11,8 +11,6 @@
namespace brep
{
- // @@@ Check if any data members are unused (once the dust settles).
-
// Service data associated with the tenant (corresponds to GH check suite).
//
// It is always a top-level JSON object and the first member is always the
@@ -35,8 +33,8 @@ namespace brep
optional<result_status> status; // Only if state is built & synced.
- // Never serialized. Only used by some of the GraphQL functions in
- // mod-ci-github-gq.hxx.
+ // Note: never serialized (only used to pass information to the GraphQL
+ // functions).
//
optional<string> details_url;
@@ -91,7 +89,8 @@ namespace brep
//
gh_installation_access_token installation_access;
- uint64_t installation_id;
+ string app_id;
+ string installation_id;
string repository_node_id; // GitHub-internal opaque repository id.
@@ -99,7 +98,7 @@ namespace brep
// The following two are only used for pull requests.
//
- // @@ TODO/LATER: maybe put them in a struct?
+ // @@ TODO/LATER: maybe put them in a struct, if more members?
//
optional<string> pr_node_id;
optional<uint32_t> pr_number;
@@ -139,6 +138,9 @@ namespace brep
//
// Throw invalid_argument if the schema version is not supported.
//
+ // Throw invalid_argument (invalid_json_input) in case of malformed JSON
+ // or any invalid values.
+ //
explicit
service_data (const string& json);
@@ -150,7 +152,8 @@ namespace brep
service_data (bool warning_success,
string iat_token,
timestamp iat_expires_at,
- uint64_t installation_id,
+ string app_id,
+ string installation_id,
string repository_node_id,
string repository_clone_url,
kind_type kind,
@@ -164,7 +167,8 @@ namespace brep
service_data (bool warning_success,
string iat_token,
timestamp iat_expires_at,
- uint64_t installation_id,
+ string app_id,
+ string installation_id,
string repository_node_id,
string repository_clone_url,
kind_type kind,
@@ -179,6 +183,11 @@ namespace brep
// Serialize to JSON.
//
+ // Throw invalid_argument if any values are invalid.
+ //
+ // May also throw invalid_json_output but that would be a programming
+ // error.
+ //
string
json () const;
};