예제 #1
0
def create_resource_link(link_id, target_id, notes=None):
    '''
    :param target_id: The id of the resource link target.
    :type target_id: str
    :param notes: Notes for this link.
    :type notes: str
    '''
    links_client = _resource_links_client_factory().resource_links
    properties = ResourceLinkProperties(target_id, notes)
    links_client.create_or_update(link_id, properties)
예제 #2
0
def update_resource_link(link_id, target_id=None, notes=None):
    '''
    :param target_id: The id of the resource link target.
    :type target_id: str
    :param notes: Notes for this link.
    :type notes: str
    '''
    links_client = _resource_links_client_factory().resource_links
    params = links_client.get(link_id)
    properties = ResourceLinkProperties(
        target_id if target_id is not None else params.properties.target_id, #pylint: disable=no-member
        notes=notes if notes is not None else params.properties.notes) #pylint: disable=no-member
    links_client.create_or_update(link_id, properties)