def METHOD_NAME(
    self, identity_pk: str = None, identity_model: IdentityModel = None
) -> list:
    if not (identity_pk or identity_model):
        raise ValueError("Must provide one of identity_pk or identity_model.")
    with suppress(ObjectDoesNotExist):
        identity = identity_model or build_identity_model(
            self.get_item_from_uuid(identity_pk)
        )
        environment_wrapper = DynamoEnvironmentWrapper()
        environment = build_environment_model(
            environment_wrapper.get_item(identity.environment_api_key)
        )
        segments = get_identity_segments(environment, identity)
        return [segment.id for segment in segments]
    return []