SnykCollection

Model for Snyk Collections.

  1. Overview

Overview

This model represents collections in a Snyk organization. Collections are used to group projects together.

import clearskies
from clearskies_snyk.models import SnykCollection


def my_handler(snyk_collection: SnykCollection):
    # Fetch all collections for an organization
    collections = snyk_collection.where("org_id=org-id-123")
    for collection in collections:
        print(f"Collection: {collection.name}")

    # Access the parent organization
    print(f"Org: {collection.org.name}")

    # Access related projects (ManyToMany)
    for project in collection.projects:
        print(f"  Project: {project.name}")