Skip to content

Import commercial peer

A modification workflow for migrating an ImportedCommercialPeer to a CommercialPeer subscription.

import_commercial_peer_subscription(subscription_id)

Take an ImportedCommercialPeer subscription, and turn it into a CommercialPeer subscription.

Source code in gso/workflows/commercial_peer/import_commercial_peer.py
@step("Create new Commercial Peer subscription")
def import_commercial_peer_subscription(subscription_id: UUIDstr) -> State:
    """Take an ImportedCommercialPeer subscription, and turn it into a CommercialPeer subscription."""
    old_commercial_peer = ImportedCommercialPeer.from_subscription(subscription_id)
    new_subscription_id = get_product_id_by_name(ProductName.COMMERCIAL_PEER)
    new_subscription = CommercialPeer.from_other_product(old_commercial_peer, new_subscription_id)  # type: ignore[arg-type]

    return {"subscription": new_subscription}

import_commercial_peer()

Modify an ImportedCommercialPeer subscription into a CommercialPeer subscription to complete the import.

Source code in gso/workflows/commercial_peer/import_commercial_peer.py
@modify_workflow("Import Commercial Peer")
def import_commercial_peer() -> StepList:
    """Modify an ImportedCommercialPeer subscription into a CommercialPeer subscription to complete the import."""
    return begin >> import_commercial_peer_subscription