Identity¶
PostProject object IDs answer “which object in this production model is this?” A production, logical asset, concrete representation, storage resource, locator, activity, job, and revision each have a distinct ID type. Matching UUID bytes do not make two different object types interchangeable. A job claim ID is a short-lived capability for one active claim, not another durable object.
An industry, registry, camera, vendor, or application identifier answers a
different question. A UMID, EIDR, ISAN, camera serial, or application ID is
stored as an external identifier; it never replaces
an AssetId, RepresentationId, or ResourceId.
This separation lets one object carry several identifiers without pretending that any single external scheme defines PostProject’s storage identity.
Across public surfaces¶
The following example serializes a typed host-object binding and parses it back without collapsing the production or object kind into raw UUID text:
static pp_error_code_t bind_representation(const pp_production_id_t *production_id,
const pp_representation_id_t *representation_id,
pp_error_t **error) {
pp_object_ref_t object;
pp_error_code_t reference_status = pp_object_ref_from_representation(*representation_id, &object, error);
if (reference_status != PP_OK) return reference_status;
char *stored = NULL;
pp_production_id_t parsed_production = {{0}};
pp_object_ref_t parsed_object = {0, {{0}}};
pp_error_code_t status =
pp_host_binding_format(*production_id, &object, &stored, error);
if (status == PP_OK) {
printf("binding: %s\n", stored);
status = pp_host_binding_parse(stored, &parsed_production, &parsed_object,
error);
}
if (status == PP_OK &&
(memcmp(&parsed_production, production_id, sizeof *production_id) != 0 ||
parsed_object.kind != object.kind ||
memcmp(&parsed_object.id, &object.id, sizeof object.id) != 0)) {
status = PP_ERROR_INTERNAL;
}
pp_string_release(stored);
return status;
}
std::string bind_representation(const postproject::Production &production,
const postproject::RepresentationId &representation_id) {
const postproject::HostObjectBinding binding{
production.id().value(), postproject::ObjectRef::representation(representation_id)};
const std::string stored = binding.toString().value();
const auto reopened = postproject::HostObjectBinding::fromString(stored).value();
require(reopened == binding, "binding round trip");
return stored;
}
def bind_representation(
production: Production, representation_id: RepresentationId
) -> str:
stored = production.host_bindings[RepresentationRef(representation_id)]
binding = production.host_bindings.parse(stored)
assert binding.production_id == production.id
assert binding.object == RepresentationRef(representation_id)
return stored
fn bind_representation(
production_id: ProductionId,
representation_id: RepresentationId,
) -> Result<String> {
let binding =
HostObjectBinding::new(production_id, ObjectRef::Representation(representation_id))?;
let stored = binding.to_string();
let reopened = HostObjectBinding::from_str(&stored)?;
assert_eq!(reopened, binding);
Ok(stored)
}
The CLI does not format or parse host-object bindings. Use one of the library surfaces.