Helpers for parsing Compute API output (self-link URLs, timestamps).
Summary
Functions
Percent-encode a single URL path segment so user-supplied resource names can't
inject extra path/query ("a/b" -> "a%2Fb", "x?y" -> "x%3Fy").
Last path segment of a GCP self-link/URL (.../zones/us-central1-a -> "us-central1-a").
Parse a GCP RFC3339 timestamp into a DateTime (nil on failure).
Coerce a GCP int-as-string (or int) into an integer; nil on anything malformed.
Functions
Percent-encode a single URL path segment so user-supplied resource names can't
inject extra path/query ("a/b" -> "a%2Fb", "x?y" -> "x%3Fy").
Raises ArgumentError on a non-binary segment — a caller/type bug (or a
malformed API response), not routine input.
Last path segment of a GCP self-link/URL (.../zones/us-central1-a -> "us-central1-a").
@spec to_datetime(String.t() | nil) :: DateTime.t() | nil
Parse a GCP RFC3339 timestamp into a DateTime (nil on failure).
Coerce a GCP int-as-string (or int) into an integer; nil on anything malformed.