def register(self, flow: 'Flow', project_name: str=None, build: bool=True, set_schedule_active: bool=True, version_group_id: str=None, compressed: bool=True, no_url: bool=False) -> str:
    "\n        Push a new flow to Prefect Cloud\n\n        Args:\n            - flow (Flow): a flow to register\n            - project_name (str, optional): the project that should contain this flow.\n            - build (bool, optional): if `True`, the flow's environment is built\n                prior to serialization; defaults to `True`\n            - set_schedule_active (bool, optional): if `False`, will set the schedule to\n                inactive in the database to prevent auto-scheduling runs (if the Flow has a\n                schedule).  Defaults to `True`. This can be changed later.\n            - version_group_id (str, optional): the UUID version group ID to use for versioning\n                this Flow in Cloud; if not provided, the version group ID associated with this\n                Flow's project and name will be used.\n            - compressed (bool, optional): if `True`, the serialized flow will be; defaults to\n                `True` compressed\n            - no_url (bool, optional): if `True`, the stdout from this function will not\n                contain the URL link to the newly-registered flow in the Cloud UI\n\n        Returns:\n            - str: the ID of the newly-registered flow\n\n        Raises:\n            - ClientError: if the register failed\n        "
    required_parameters = {p for p in flow.parameters() if p.required}
    if ((flow.schedule is not None) and required_parameters):
        required_names = {p.name for p in required_parameters}
        if (not all([(required_names <= set(c.parameter_defaults.keys())) for c in flow.schedule.clocks])):
            raise ClientError('Flows with required parameters can not be scheduled automatically.')
    if (any((e.key for e in flow.edges)) and (flow.result is None)):
        warnings.warn('No result handler was specified on your Flow. Cloud features such as input caching and resuming task runs from failure may not work properly.', stacklevel=2)
    if compressed:
        create_mutation = {'mutation($input: create_flow_from_compressed_string_input!)': {'create_flow_from_compressed_string(input: $input)': {'id'}}}
    else:
        create_mutation = {'mutation($input: create_flow_input!)': {'create_flow(input: $input)': {'id'}}}
    project = None
    if (project_name is None):
        raise TypeError("'project_name' is a required field when registering a flow.")
    query_project = {'query': {with_args('project', {'where': {'name': {'_eq': project_name}}}): {'id': True}}}
    project = self.graphql(query_project).data.project
    if (not project):
        raise ValueError("Project {} not found. Run `prefect create project '{}'` to create it.".format(project_name, project_name))
    serialized_flow = flow.serialize(build=build)
    if isinstance(flow.storage, prefect.environments.storage.Docker):
        flow.environment.metadata['image'] = flow.storage.name
        serialized_flow = flow.serialize(build=False)
    if (not flow.environment.metadata.get('image')):
        version = prefect.__version__.split('+')[0]
        flow.environment.metadata['image'] = f'prefecthq/prefect:all_extras-{version}'
        serialized_flow = flow.serialize(build=False)
    try:
        prefect.serialization.flow.FlowSchema().load(serialized_flow)
    except Exception as exc:
        raise ValueError('Flow could not be deserialized successfully. Error was: {}'.format(repr(exc))) from exc
    if compressed:
        serialized_flow = compress(serialized_flow)
    res = self.graphql(create_mutation, variables=dict(input=dict(project_id=(project[0].id if project else None), serialized_flow=serialized_flow, set_schedule_active=set_schedule_active, version_group_id=version_group_id)), retry_on_api_error=False)
    flow_id = (res.data.create_flow_from_compressed_string.id if compressed else res.data.create_flow.id)
    if (not no_url):
        flow_url = self.get_cloud_url('flow', flow_id)
        prefix = '└── '
        print('Flow URL: {}'.format(flow_url))
        msg = f''' {prefix}ID: {flow_id}
 {prefix}Project: {project_name}
 {prefix}Labels: {list(flow.environment.labels)}'''
        print(msg)
    return flow_id
Push a new flow to Prefect Cloud

Args:
    - flow (Flow): a flow to register
    - project_name (str, optional): the project that should contain this flow.
    - build (bool, optional): if `True`, the flow's environment is built
        prior to serialization; defaults to `True`
    - set_schedule_active (bool, optional): if `False`, will set the schedule to
        inactive in the database to prevent auto-scheduling runs (if the Flow has a
        schedule).  Defaults to `True`. This can be changed later.
    - version_group_id (str, optional): the UUID version group ID to use for versioning
        this Flow in Cloud; if not provided, the version group ID associated with this
        Flow's project and name will be used.
    - compressed (bool, optional): if `True`, the serialized flow will be; defaults to
        `True` compressed
    - no_url (bool, optional): if `True`, the stdout from this function will not
        contain the URL link to the newly-registered flow in the Cloud UI

Returns:
    - str: the ID of the newly-registered flow

Raises:
    - ClientError: if the register failed
def register(self, flow: 'Flow', project_name: str=None, build: bool=True, set_schedule_active: bool=True, version_group_id: str=None, compressed: bool=True, no_url: bool=False) -> str:
    "\n        Push a new flow to Prefect Cloud\n\n        Args:\n            - flow (Flow): a flow to register\n            - project_name (str, optional): the project that should contain this flow.\n            - build (bool, optional): if `True`, the flow's environment is built\n                prior to serialization; defaults to `True`\n            - set_schedule_active (bool, optional): if `False`, will set the schedule to\n                inactive in the database to prevent auto-scheduling runs (if the Flow has a\n                schedule).  Defaults to `True`. This can be changed later.\n            - version_group_id (str, optional): the UUID version group ID to use for versioning\n                this Flow in Cloud; if not provided, the version group ID associated with this\n                Flow's project and name will be used.\n            - compressed (bool, optional): if `True`, the serialized flow will be; defaults to\n                `True` compressed\n            - no_url (bool, optional): if `True`, the stdout from this function will not\n                contain the URL link to the newly-registered flow in the Cloud UI\n\n        Returns:\n            - str: the ID of the newly-registered flow\n\n        Raises:\n            - ClientError: if the register failed\n        "
    required_parameters = {p for p in flow.parameters() if p.required}
    if ((flow.schedule is not None) and required_parameters):
        required_names = {p.name for p in required_parameters}
        if (not all([(required_names <= set(c.parameter_defaults.keys())) for c in flow.schedule.clocks])):
            raise ClientError('Flows with required parameters can not be scheduled automatically.')
    if (any((e.key for e in flow.edges)) and (flow.result is None)):
        warnings.warn('No result handler was specified on your Flow. Cloud features such as input caching and resuming task runs from failure may not work properly.', stacklevel=2)
    if compressed:
        create_mutation = {'mutation($input: create_flow_from_compressed_string_input!)': {'create_flow_from_compressed_string(input: $input)': {'id'}}}
    else:
        create_mutation = {'mutation($input: create_flow_input!)': {'create_flow(input: $input)': {'id'}}}
    project = None
    if (project_name is None):
        raise TypeError("'project_name' is a required field when registering a flow.")
    query_project = {'query': {with_args('project', {'where': {'name': {'_eq': project_name}}}): {'id': True}}}
    project = self.graphql(query_project).data.project
    if (not project):
        raise ValueError("Project {} not found. Run `prefect create project '{}'` to create it.".format(project_name, project_name))
    serialized_flow = flow.serialize(build=build)
    if isinstance(flow.storage, prefect.environments.storage.Docker):
        flow.environment.metadata['image'] = flow.storage.name
        serialized_flow = flow.serialize(build=False)
    if (not flow.environment.metadata.get('image')):
        version = prefect.__version__.split('+')[0]
        flow.environment.metadata['image'] = f'prefecthq/prefect:all_extras-{version}'
        serialized_flow = flow.serialize(build=False)
    try:
        prefect.serialization.flow.FlowSchema().load(serialized_flow)
    except Exception as exc:
        raise ValueError('Flow could not be deserialized successfully. Error was: {}'.format(repr(exc))) from exc
    if compressed:
        serialized_flow = compress(serialized_flow)
    res = self.graphql(create_mutation, variables=dict(input=dict(project_id=(project[0].id if project else None), serialized_flow=serialized_flow, set_schedule_active=set_schedule_active, version_group_id=version_group_id)), retry_on_api_error=False)
    flow_id = (res.data.create_flow_from_compressed_string.id if compressed else res.data.create_flow.id)
    if (not no_url):
        flow_url = self.get_cloud_url('flow', flow_id)
        prefix = '└── '
        print('Flow URL: {}'.format(flow_url))
        msg = f' {prefix}ID: {flow_id}
 {prefix}Project: {project_name}
 {prefix}Labels: {list(flow.environment.labels)}'
        print(msg)
    return flow_id