(self, ticket, snapshot_code, file_path, type='ref', tag='main')
return self._get_sobject_dict(snapshot)
method to append a dependency reference to an existing checkin.
        The snapshot that this is attached will be auto-discovered

        @params
        ticket - authentication ticket
        snapshot_code - the unique code identifier of a snapshot
        file_path - the path of the dependent file
        type - type of dependency.  Values include 'ref' and 'input_ref'
            ref = hierarchical reference:   ie A contains B
            input_ref - input reference:    ie: A was used to create B
        tag - a tagged keyword can be added to a dependency to categorize
            the different dependencies that exist in a snapshot

        @return
        the resulting snapshot
method to append a dependency reference to an existing checkin.
        The snapshot that this is attached will be auto-discovered
method to append a dependency reference to an existing checkin . The snapshot that this is attached will be auto - discovered
def add_dependency(self, ticket, snapshot_code, file_path, type='ref', tag='main'):
        '''method to append a dependency reference to an existing checkin.
        The snapshot that this is attached will be auto-discovered

        @params
        ticket - authentication ticket
        snapshot_code - the unique code identifier of a snapshot
        file_path - the path of the dependent file
        type - type of dependency.  Values include 'ref' and 'input_ref'
            ref = hierarchical reference:   ie A contains B
            input_ref - input reference:    ie: A was used to create B
        tag - a tagged keyword can be added to a dependency to categorize
            the different dependencies that exist in a snapshot

        @return
        the resulting snapshot
        '''
        if isinstance(snapshot_code, dict):
            snapshot_code = snapshot_code.get('code')
        elif snapshot_code.startswith("sthpw/snapshot?"):
            snapshot = Search.get_by_search_key(snapshot_code)
        else:
            snapshot = Snapshot.get_by_code(snapshot_code)
        if not snapshot:
            raise ApiException("Snapshot with code [%s] does not exist" % \
                snapshot_code)

        xml = snapshot.get_xml_value("snapshot")
        builder = SnapshotBuilder(xml)
        builder.add_ref_by_file_path(file_path, tag=tag)
        snapshot.set_value("snapshot", builder.to_string() )
        snapshot.commit()

        return self._get_sobject_dict(snapshot)
def add_dependency ( self , ticket , snapshot_code , file_path , type = 'ref' , tag = 'main' ) : if isinstance ( snapshot_code , dict ) : snapshot_code = snapshot_code . get ( 'code' ) elif snapshot_code . startswith ( "sthpw/snapshot?" ) : snapshot = Search . get_by_search_key ( snapshot_code ) else : snapshot = Snapshot . get_by_code ( snapshot_code ) if not snapshot : raise ApiException ( "Snapshot with code [%s] does not exist" % snapshot_code ) xml = snapshot . get_xml_value ( "snapshot" ) builder = SnapshotBuilder ( xml ) builder . add_ref_by_file_path ( file_path , tag = tag ) snapshot . set_value ( "snapshot" , builder . to_string ( ) ) snapshot . commit ( ) return self . _get_sobject_dict ( snapshot )