l.c.i.g.IGitRepositoryEdit(IWebhookTarget) : interface documentation

Part of lp.code.interfaces.gitrepository View In Hierarchy

Known subclasses: lp.code.interfaces.webservice.IGitRepository

IGitRepository methods that require launchpad.Edit permission.
Method setName Set the name of the repository to be new_name.
Method setOwner Set the owner of the repository to be new_owner.
Method setTarget Set the target of the repository.
Method rescan Force a rescan of this repository.
Method addRule Add an access rule to this repository.
Method moveRule Move a rule to a new position in its repository's rule order.
Method findRuleGrantsByGrantee Find the grants for a grantee applied to this repository.
Method getRules Get the access rules for this repository.
Method setRules Set the access rules for this repository.
Method checkRefPermissions Check a person's permissions on some references in this repository.
Method api_checkRefPermissions Check a person's permissions on some references in this repository.
Method canBeDeleted Can this repository be deleted in its current state?
Method getDeletionRequirements Determine what is required to delete this branch.
Method destroySelf Delete the specified repository.

Inherited from IWebhookTarget:

List valid_webhook_event_types Valid event types for this object type.
List default_webhook_event_types Default event types for new webhooks attached to this object type.
Method newWebhook Create a new webhook.
@mutator_for(IGitRepositoryView['name'])
@call_with(REQUEST_USER)
@operation_parameters(TextLine(_('The new name of the repository.')))
@export_write_operation()
@operation_for_version('devel')
def setName(new_name, user):
Set the name of the repository to be new_name.
@mutator_for(IGitRepositoryView['owner'])
@call_with(REQUEST_USER)
@operation_parameters(Reference(_('The new owner of the repository.'), IPerson))
@export_write_operation()
@operation_for_version('devel')
def setOwner(new_owner, user):
Set the owner of the repository to be new_owner.
@mutator_for(IGitRepositoryView['target'])
@call_with(REQUEST_USER)
@operation_parameters(Reference(_('The project, distribution source package, or person the repository belongs to.'), IHasGitRepositories, True))
@export_write_operation()
@operation_for_version('devel')
def setTarget(target, user):
Set the target of the repository.
@export_write_operation()
@operation_for_version('devel')
def rescan():
Force a rescan of this repository.

This may be helpful in cases where a previous scan crashed.

def addRule(ref_pattern, creator, position=None):
Add an access rule to this repository.
Parametersref_patternThe reference pattern that the new rule should match.
creatorThe IPerson who is adding the rule.
positionThe list position at which to insert the rule, or None to append it.
def moveRule(rule, position, user):
Move a rule to a new position in its repository's rule order.
ParametersruleThe IGitRule to move.
positionThe new position. For example, 0 puts the rule at the start, while len(repository.rules) puts the rule at the end. If the new position is before the end of the list, then other rules are shifted to later positions to make room.
userThe IPerson who is moving the rule.
def findRuleGrantsByGrantee(grantee, include_transitive=True, ref_pattern=None):
Find the grants for a grantee applied to this repository.
ParametersgranteeThe IPerson to search for, or an item of GitGranteeType other than GitGranteeType.PERSON to search for some other kind of entity.
include_transitiveIf False, match grantee exactly; if True (the default), also accept teams of which grantee is a member.
ref_patternIf not None, only return grants for rules with this ref_pattern.
@export_read_operation()
@operation_for_version('devel')
def getRules():
Get the access rules for this repository.
@operation_parameters(List(_('Rules'), InlineObject(Interface), _(dedent(' The new list of rules for this repository. For example::\n\n [\n {\n "ref_pattern": "refs/heads/*",\n "grants": [\n {\n "grantee_type": "Repository owner",\n "can_create": true,\n "can_push": true,\n "can_force_push": true\n }\n ]\n },\n {\n "ref_pattern": "refs/heads/stable/*",\n "grants": [\n {\n "grantee_type": "Person",\n "grantee_link": "/~example-stable-team",\n "can_create": true,\n "can_push": true\n }\n ]\n }\n ]'))))
@call_with(REQUEST_USER)
@export_write_operation()
@operation_for_version('devel')
def setRules(rules, user):
Set the access rules for this repository.
def checkRefPermissions(person, ref_paths):
Check a person's permissions on some references in this repository.
ParameterspersonAn IPerson to check, or GitGranteeType.REPOSITORY_OWNER to check an anonymous repository owner.
ref_pathsAn iterable of reference paths (each of which may be either bytes or text).
ReturnsA dict mapping reference paths to sets of GitPermissionType, corresponding to the requested person's effective permissions on each of the requested references.
@operation_parameters(Reference(_('Person to check'), IPerson), List(_('Reference paths'), TextLine()))
@export_operation_as('checkRefPermissions')
@export_read_operation()
@operation_for_version('devel')
def api_checkRefPermissions(person, paths):
Check a person's permissions on some references in this repository.
ParameterspersonAn IPerson to check.
pathsAn iterable of reference paths.
ReturnsA dict mapping reference paths to lists of zero or more of "create", "push", and "force-push", indicating the requested person's effective permissions on each of the requested references.
@export_read_operation()
@operation_for_version('devel')
def canBeDeleted():
Can this repository be deleted in its current state?

A repository is considered deletable if it is not linked to any merge proposals.

def getDeletionRequirements(eager_load=False):
Determine what is required to delete this branch.
Parameterseager_loadIf True, preload related information needed to display the deletion requirements.
Returnsa dict of {object: (operation, reason)}, where object is the object that must be deleted or altered, operation is either "delete" or "alter", and reason is a string explaining why the object needs to be touched.
@call_with(True)
@export_destructor_operation()
@operation_for_version('devel')
def destroySelf(break_references=False):
Delete the specified repository.
Parametersbreak_referencesIf supplied, break any references to this repository by deleting items with mandatory references and NULLing other references.
RaisesCannotDeleteGitRepository if the repository cannot be deleted.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.