@@ -505,30 +505,6 @@ def delete(self):
505505 return self ._boolean (self ._delete (url ), 204 , 403 )
506506
507507
508- class Contributor (_User ):
509- """Object for the specialized representation of a contributor.
510-
511- When retrieving a repository's contributors, GitHub returns the same
512- information as a :class:`~github3.users.ShortUser` with an additional
513- attribute:
514-
515- .. versionadded:: 1.0.0
516-
517- This class was added in version 1.0.0
518-
519- .. attribute:: contributions_count
520-
521- The number of contributions a contributor has made to the repository
522-
523- """
524-
525- class_name = 'Contributor'
526-
527- def _update_attributes (self , contributor ):
528- super (Contributor , self )._update_attributes (contributor )
529- self .contributions = contributor ['contributions' ]
530-
531-
532508class User (_User ):
533509 """Object for the full representation of a User.
534510
@@ -765,3 +741,57 @@ def _update_attributes(self, user):
765741 self .plan = user .get ('plan' )
766742 if self .plan is not None :
767743 self .plan = Plan (self .plan , self )
744+
745+
746+ class Collaborator (_User ):
747+ """Object for the representation of a collaborator.
748+
749+ .. versionadded:: 1.1.0
750+
751+ When retrieving a repository's contributors, GitHub returns the same
752+ information as a :class:`~github3.users.ShortUser` with an additional
753+ attribute:
754+
755+ .. attribute:: permissions
756+
757+ Admin, push, and pull permissions of a collaborator
758+ """
759+
760+ class_name = 'Collaborator'
761+ _refresh_to = User
762+
763+ def _update_attributes (self , user ):
764+ super (Collaborator , self )._update_attributes (user )
765+
766+ self .permissions = user ['permissions' ]
767+
768+
769+ class Contributor (_User ):
770+ """Object for the specialized representation of a contributor.
771+
772+ .. versionadded:: 1.0.0
773+
774+ .. versionchanged:: 1.1.0
775+
776+ This class now refreshes to a :class:`~github3.users.User`.
777+
778+ The attribute ``contributions`` was renamed to ``contributions_count``,
779+ the documentation already declared it as ``contributions_count``, it
780+ was the implementation now reflects this as well.
781+
782+ When retrieving a repository's contributors, GitHub returns the same
783+ information as a :class:`~github3.users.ShortUser` with an additional
784+ attribute:
785+
786+ .. attribute:: contributions_count
787+
788+ The number of contributions a contributor has made to the repository
789+
790+ """
791+
792+ class_name = 'Contributor'
793+ _refresh_to = User
794+
795+ def _update_attributes (self , contributor ):
796+ super (Contributor , self )._update_attributes (contributor )
797+ self .contributions_count = contributor ['contributions' ]
0 commit comments