diff --git a/CodeGenerator/templates/GithubObject.Concatenation.py b/CodeGenerator/templates/GithubObject.Concatenation.py new file mode 100644 index 00000000..466857ad --- /dev/null +++ b/CodeGenerator/templates/GithubObject.Concatenation.py @@ -0,0 +1 @@ +{% for part in concatenation %}{% if forloop.counter0 > 0 %} + {% endif %}{% if part.type == "constant" %}"{{ part.value }}"{% endif %}{% if part.type == "argument" %}{{ part.value|join:"." }}{% endif %}{% if part.type == "attribute" %}self.{{ part.value|join:"." }}{% endif %}{% endfor %} \ No newline at end of file diff --git a/CodeGenerator/templates/GithubObject.Parameters.py b/CodeGenerator/templates/GithubObject.Parameters.py new file mode 100644 index 00000000..247eb246 --- /dev/null +++ b/CodeGenerator/templates/GithubObject.Parameters.py @@ -0,0 +1 @@ +self{% for parameter in function.mandatory_parameters %}, {{ parameter.name }}{% endfor %}{% for parameter in function.optional_parameters %}, {{ parameter.name }} = None{% endfor %}{% if function.variadic_parameter %}, *{{ function.variadic_parameter.name }}s{% endif %} \ No newline at end of file diff --git a/CodeGenerator/templates/GithubObject.py b/CodeGenerator/templates/GithubObject.py new file mode 100644 index 00000000..522a61bf --- /dev/null +++ b/CodeGenerator/templates/GithubObject.py @@ -0,0 +1,59 @@ +class {{ class.name }}( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + +{% for attribute in class.attributes %} + @property + def {{ attribute.name }}( self ): + if self.__{{ attribute.name }} is None: + self.__completeIfNeeded() + return self.__{{ attribute.name }} +{% endfor %} + + def __initAttributes( self ): +{% for attribute in class.attributes %} + self.__{{ attribute.name }} = None +{% endfor %} + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + +{% for method in class.methods|dictsort:"name" %} + def {{ method.name|join:"_" }}( {% include "GithubObject.Parameters.py" with function=method only %} ): +{% if method.request %} + result = self.__github._dataRequest( + "{{ method.request.verb }}", + {% include "GithubObject.Concatenation.py" with concatenation=method.request.url only %}, + None, + None + ) + +{% if method.type.cardinality == "scalar" %} + return {{ method.type.name }}.{{ method.type.name }}( self.__github, result, lazy = True ) +{% endif %} + +{% if method.type.cardinality == "list" %} + return [ + {{ method.type.name }}.{{ method.type.name }}( self.__github, element, lazy = True ) + for element in result + ] +{% endif %} + +{% else %} + pass +{% endif %} +{% endfor %} + + def __useAttributes( self, attributes ): +{% for attribute in class.attributes %} + if "{{ attribute.name }}" in attributes: + self.__{{ attribute.name }} = attributes[ "{{ attribute.name }}" ] +{% endfor %} diff --git a/CodeGenerator/templates/ReferenceOfClasses.Parameters.md b/CodeGenerator/templates/ReferenceOfClasses.Parameters.md new file mode 100644 index 00000000..03301e69 --- /dev/null +++ b/CodeGenerator/templates/ReferenceOfClasses.Parameters.md @@ -0,0 +1 @@ +{% if function.mandatory_parameters or function.optional_parameters or function.variadic_parameter %} {% for parameter in function.mandatory_parameters %}{% if forloop.counter0 > 0 %}, {% endif %}{{ parameter.name }}{% endfor %}{% if function.mandatory_parameters and function.optional_parameters %}, {% endif %}{% if function.optional_parameters %}[{% for parameter in function.optional_parameters %}{% if forloop.counter0 > 0 %}, {% endif %}{{ parameter.name }}{% endfor %}]{% endif %}{% if function.variadic_parameter %}{{ function.variadic_parameter.name }}, ...{% endif %} {% endif %} \ No newline at end of file diff --git a/CodeGenerator/templates/ReferenceOfClasses.Type.md b/CodeGenerator/templates/ReferenceOfClasses.Type.md new file mode 100644 index 00000000..9d7ecff2 --- /dev/null +++ b/CodeGenerator/templates/ReferenceOfClasses.Type.md @@ -0,0 +1 @@ +{% if type.name != "void" and type.name != "@todo" %}: {% if type.cardinality == "list" %}list of {% endif %}{% if not type.simple %}`{% endif %}{{ type.name }}{% if not type.simple %}`{% endif %}{% endif %} \ No newline at end of file diff --git a/CodeGenerator/templates/ReferenceOfClasses.md b/CodeGenerator/templates/ReferenceOfClasses.md new file mode 100644 index 00000000..81ec690e --- /dev/null +++ b/CodeGenerator/templates/ReferenceOfClasses.md @@ -0,0 +1,47 @@ +You don't normaly create instances of any class but `Github`. +You obtain instances through calls to `get_` and `create_` methods. + +Class `Github` +============== +* Constructed from user's login and password +* `get_user()`: `AuthenticatedUser` +* `get_user( login )`: `NamedUser` +* `get_organization( login )`: `Organization` +* `get_gist( id )`: `Gist` +* `get_gists()`: list of `Gist` + +{% for class in classes|dictsort:"name" %} +Class `{{ class.name }}` +======={% for char in class.name %}={% endfor %}= + +Attributes +---------- +{% for attribute in class.attributes|dictsort:"name" %}* `{{ attribute.name }}`{% include "ReferenceOfClasses.Type.md" with type=attribute.type only %} +{% endfor %} + +{% regroup class.methods|dictsort:"group" by group as method_groups %} + +{% for method_group in method_groups %} + +{{ method_group.grouper|capfirst }} +{% for letter in method_group.grouper %}-{% endfor %} + +{% for method in method_group.list %} + +* `{{ method.name|join:"_" }}({% include "ReferenceOfClasses.Parameters.md" with function=method only %})`{% include "ReferenceOfClasses.Type.md" with type=method.type only %} + +{% for parameter in method.mandatory_parameters %} + * `{{ parameter.name }}`{% include "ReferenceOfClasses.Type.md" with type=parameter.type only %} +{% endfor %} +{% for parameter in method.optional_parameters %} + * `{{ parameter.name }}`{% include "ReferenceOfClasses.Type.md" with type=parameter.type only %} +{% endfor %} +{% if method.variadic_parameter %} + * `{{ method.variadic_parameter.name }}`{% include "ReferenceOfClasses.Type.md" with type=method.variadic_parameter.type only %} +{% endif %} + +{% endfor %} + +{% endfor %} + +{% endfor %} diff --git a/GenerateCode.py b/GenerateCode.py new file mode 100644 index 00000000..c4d552f4 --- /dev/null +++ b/GenerateCode.py @@ -0,0 +1,49 @@ +#!/bin/env python + +import json + +import django.conf +import django.template +import django.template.loader + +django.conf.settings.configure( + TEMPLATE_DIRS = ( + "CodeGenerator/templates", + ) +) + +description = json.load( open( "JsonDescriptionOfGithubApiV3/description.001.normalized.json" ) ) + +githubObjectTemplate = django.template.loader.get_template( "GithubObject.py" ) +for class_ in description[ "classes" ]: + with open( "github/GithubObjects/" + class_[ "name" ] + ".py", "w" ) as f: + f.write( "# WARNING: this file is generated automaticaly.\n" ) + f.write( "# Do not modify it manually, your work would be lost.\n" ) + f.write( "\n" ) + rawCode = githubObjectTemplate.render( django.template.Context( { "class": class_ } ) ).split( "\n" ) + code = list() + for line in rawCode: + line = line.rstrip() + if line == "": + continue + if len( code ) > 0 and code[ -1 ].startswith( " " ) and line.startswith( " " ) and not line.startswith( " " ): + code.append( "" ) + if line.startswith( "class" ): + code.append( "" ) + code.append( line ) + f.write( "\n".join( code ) + "\n" ) + +referenceOfClassesTemplate = django.template.loader.get_template( "ReferenceOfClasses.md" ) +with open( "ReferenceOfClasses.md", "w" ) as f: + rawCode = referenceOfClassesTemplate.render( django.template.Context( description ) ).split( "\n" ) + code = list() + for line in rawCode: + line = line.rstrip() + if line == "": + continue + if not line.lstrip().startswith( "*" ) and len( code ) > 0: + prevLine = code[ -1 ].lstrip() + if prevLine.startswith( "*" ) or prevLine.startswith( "=" ): + code.append( "" ) + code.append( line ) + f.write( "\n".join( code ) + "\n" ) diff --git a/IntegrationTest.py b/IntegrationTest.py index 82be8f1b..953d9a2a 100644 --- a/IntegrationTest.py +++ b/IntegrationTest.py @@ -65,8 +65,14 @@ class ReplayingHttpsConnection: def request( self, verb, url, input, headers ): del headers[ "Authorization" ] expectation = self.__file.readline().strip() + while expectation.startswith( "#" ): + self.__file.readline() + self.__file.readline() + self.__file.readline() + self.__file.readline() + expectation = self.__file.readline().strip() if expectation != verb + " " + url + " " + str( headers ) + " " + input: - # print expectation, "!=", verb + " " + url + " " + str( headers ) + " " + input + print expectation, "!=", verb + " " + url + " " + str( headers ) + " " + input raise RecordReplayException( "This test has been changed since last record. Please re-run this script with argument '--record'" ) def getresponse( self ): @@ -101,8 +107,8 @@ class IntegrationTest: tests = argv self.runTests( tests, record ) - if self.succeeded: - self.analyseCoverage() + # if self.succeeded: + # self.analyseCoverage() def prepareRecord( self, test ): self.avoidError500FromGithub = lambda: time.sleep( 1 ) @@ -146,7 +152,15 @@ class IntegrationTest: self.prepareReplay( test ) getattr( self, "test" + test )() if not record: - if self.__file.readline(): + nextLine = self.__file.readline() + while nextLine.startswith( "#" ): + self.__file.readline() + self.__file.readline() + self.__file.readline() + self.__file.readline() + nextLine = self.__file.readline() + if nextLine: + print nextLine[ : 100 ] raise RecordReplayException( "This test has been changed since last record. Please re-run this script with argument '--record'" ) except RecordReplayException, e: print "*" * len( str( e ) ) @@ -205,55 +219,55 @@ class IntegrationTest: u = self.g.get_user() self.printList( "Organizations", u.get_orgs(), lambda o: o.login ) - def testColaborators( self ): - r = self.g.get_user().get_repo( "TestPyGithub" ) - cobaye = self.g.get_user( self.cobayeUser ) - self.printList( "Collaborators", r.get_collaborators(), lambda m: m.login ) - r.add_to_collaborators( cobaye ) - assert r.has_in_collaborators( cobaye ) - self.printList( "Collaborators", r.get_collaborators(), lambda m: m.login ) - r.remove_from_collaborators( cobaye ) - assert not r.has_in_collaborators( cobaye ) - self.printList( "Collaborators", r.get_collaborators(), lambda m: m.login ) + # def testColaborators( self ): + # r = self.g.get_user().get_repo( "TestPyGithub" ) + # cobaye = self.g.get_user( self.cobayeUser ) + # self.printList( "Collaborators", r.get_collaborators(), lambda m: m.login ) + # r.add_to_collaborators( cobaye ) + # assert r.has_in_collaborators( cobaye ) + # self.printList( "Collaborators", r.get_collaborators(), lambda m: m.login ) + # r.remove_from_collaborators( cobaye ) + # assert not r.has_in_collaborators( cobaye ) + # self.printList( "Collaborators", r.get_collaborators(), lambda m: m.login ) - def testCommentCommit( self ): - r = self.g.get_user().get_repo( "TestPyGithub" ) - c = r.get_commits()[ 0 ] - self.printList( "Comments", c.get_comments(), lambda c: c.body ) - com1 = c.create_comment( "Comment created by PyGithub" ) - self.printList( "Comments", c.get_comments(), lambda c: c.body ) - com2 = c.create_comment( "Comment also created by PyGithub", path = "ReadMe.md", line = 1 ) - self.printList( "Comments", c.get_comments(), lambda c: c.body ) - com2.delete() - com1.edit( body = "Comment edited by PyGithub" ) - self.printList( "Comments", c.get_comments(), lambda c: c.body ) + # def testCommentCommit( self ): + # r = self.g.get_user().get_repo( "TestPyGithub" ) + # c = r.get_commits()[ 0 ] + # self.printList( "Comments", c.get_comments(), lambda c: c.body ) + # com1 = c.create_comment( "Comment created by PyGithub" ) + # self.printList( "Comments", c.get_comments(), lambda c: c.body ) + # com2 = c.create_comment( "Comment also created by PyGithub", path = "ReadMe.md", line = 1 ) + # self.printList( "Comments", c.get_comments(), lambda c: c.body ) + # com2.delete() + # com1.edit( body = "Comment edited by PyGithub" ) + # self.printList( "Comments", c.get_comments(), lambda c: c.body ) - def testCreateForkForOrganization( self ): - o = self.g.get_organization( self.cobayeOrganization ) - r = self.g.get_user().get_repo( "TestPyGithub" ) - rf = o.create_fork( r ) - print r.owner.login + "/" + r.name, "->", rf.owner.login + "/" + rf.name + # def testCreateForkForOrganization( self ): + # o = self.g.get_organization( self.cobayeOrganization ) + # r = self.g.get_user().get_repo( "TestPyGithub" ) + # rf = o.create_fork( r ) + # print r.owner.login + "/" + r.name, "->", rf.owner.login + "/" + rf.name - def testCreateRepoForOrganization( self ): - o = self.g.get_organization( self.cobayeOrganization ) - self.printList( "Repos", o.get_repos(), lambda r: r.name ) - r = o.create_repo( "CreatedByPyGithub", has_wiki = False ) - self.printList( "Repos", o.get_repos(), lambda r: r.name ) + # def testCreateRepoForOrganization( self ): + # o = self.g.get_organization( self.cobayeOrganization ) + # self.printList( "Repos", o.get_repos(), lambda r: r.name ) + # r = o.create_repo( "CreatedByPyGithub", has_wiki = False ) + # self.printList( "Repos", o.get_repos(), lambda r: r.name ) - def testCreateRepoForUser( self ): - u = self.g.get_user() - self.printList( "Repos", u.get_repos(), lambda r: r.name ) - r = u.create_repo( "CreatedByPyGithub", has_wiki = False ) - self.printList( "Repos", u.get_repos(), lambda r: r.name ) + # def testCreateRepoForUser( self ): + # u = self.g.get_user() + # self.printList( "Repos", u.get_repos(), lambda r: r.name ) + # r = u.create_repo( "CreatedByPyGithub", has_wiki = False ) + # self.printList( "Repos", u.get_repos(), lambda r: r.name ) - def testDownloads( self ): - r = self.g.get_user().get_repo( "TestPyGithub" ) - self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) - d = r.create_download( "DownloadCreatedByPyGithub.txt", 1024 ) - self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) - sameDownload = r.get_download( d.id ) - sameDownload.delete() - self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) + # def testDownloads( self ): + # r = self.g.get_user().get_repo( "TestPyGithub" ) + # self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) + # d = r.create_download( "DownloadCreatedByPyGithub.txt", 1024 ) + # self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) + # sameDownload = r.get_download( d.id ) + # sameDownload.delete() + # self.printList( "Downloads", r.get_downloads(), lambda d: d.name ) def testEditAuthenticatedUser( self ): u = self.g.get_user() @@ -264,253 +278,253 @@ class IntegrationTest: u.edit( name = originalName ) print u.name - def testEditOrganization( self ): - o = self.g.get_organization( self.cobayeOrganization ) - originalName = o.name - print o.name - o.edit( name = str( o.name ) + " (edited by PyGithub)" ) - print o.name - o.edit( name = originalName ) - print o.name + # def testEditOrganization( self ): + # o = self.g.get_organization( self.cobayeOrganization ) + # originalName = o.name + # print o.name + # o.edit( name = str( o.name ) + " (edited by PyGithub)" ) + # print o.name + # o.edit( name = originalName ) + # print o.name - def testEditOrganizationTeamAndMembers( self ): - o = self.g.get_organization( self.cobayeOrganization ) - r = o.get_repo( "TestPyGithub" ) + # def testEditOrganizationTeamAndMembers( self ): + # o = self.g.get_organization( self.cobayeOrganization ) + # r = o.get_repo( "TestPyGithub" ) - self.printList( "Teams", o.get_teams(), lambda t: t.name ) - t = o.create_team( "PyGithubTesters" ) - t.edit( "PyGithubTesters", permission = "push" ) - self.printList( "Teams", o.get_teams(), lambda t: t.name ) + # self.printList( "Teams", o.get_teams(), lambda t: t.name ) + # t = o.create_team( "PyGithubTesters" ) + # t.edit( "PyGithubTesters", permission = "push" ) + # self.printList( "Teams", o.get_teams(), lambda t: t.name ) - u = self.g.get_user( self.cobayeUser ) + # u = self.g.get_user( self.cobayeUser ) - self.printList( "Team members", t.get_members(), lambda m: m.login ) - self.printList( "Team repos", t.get_repos(), lambda r: r.name ) - assert not t.has_in_repos( r ) - assert not t.has_in_members( u ) - t.add_to_members( u ) - t.add_to_repos( r ) - assert t.has_in_repos( r ) - assert t.has_in_members( u ) - self.printList( "Team members", t.get_members(), lambda m: m.login ) - self.printList( "Team repos", t.get_repos(), lambda r: r.name ) + # self.printList( "Team members", t.get_members(), lambda m: m.login ) + # self.printList( "Team repos", t.get_repos(), lambda r: r.name ) + # assert not t.has_in_repos( r ) + # assert not t.has_in_members( u ) + # t.add_to_members( u ) + # t.add_to_repos( r ) + # assert t.has_in_repos( r ) + # assert t.has_in_members( u ) + # self.printList( "Team members", t.get_members(), lambda m: m.login ) + # self.printList( "Team repos", t.get_repos(), lambda r: r.name ) - self.printList( "Public members", o.get_public_members(), lambda m: m.login ) - o.add_to_public_members( u ) - assert o.has_in_public_members( u ) - self.printList( "Public members", o.get_public_members(), lambda m: m.login ) - o.remove_from_public_members( u ) - assert not o.has_in_public_members( u ) - self.printList( "Public members", o.get_public_members(), lambda m: m.login ) + # self.printList( "Public members", o.get_public_members(), lambda m: m.login ) + # o.add_to_public_members( u ) + # assert o.has_in_public_members( u ) + # self.printList( "Public members", o.get_public_members(), lambda m: m.login ) + # o.remove_from_public_members( u ) + # assert not o.has_in_public_members( u ) + # self.printList( "Public members", o.get_public_members(), lambda m: m.login ) - self.printList( "Members", o.get_members(), lambda m: m.login ) - assert o.has_in_members( u ) - o.remove_from_members( u ) - assert not o.has_in_members( u ) - self.printList( "Members", o.get_members(), lambda m: m.login ) + # self.printList( "Members", o.get_members(), lambda m: m.login ) + # assert o.has_in_members( u ) + # o.remove_from_members( u ) + # assert not o.has_in_members( u ) + # self.printList( "Members", o.get_members(), lambda m: m.login ) - self.printList( "Team members", t.get_members(), lambda m: m.login ) - self.printList( "Team repos", t.get_repos(), lambda r: r.name ) - t.remove_from_members( u ) - t.remove_from_repos( r ) - assert not t.has_in_repos( r ) - assert not t.has_in_members( u ) - self.printList( "Team members", t.get_members(), lambda m: m.login ) - self.printList( "Team repos", t.get_repos(), lambda r: r.name ) + # self.printList( "Team members", t.get_members(), lambda m: m.login ) + # self.printList( "Team repos", t.get_repos(), lambda r: r.name ) + # t.remove_from_members( u ) + # t.remove_from_repos( r ) + # assert not t.has_in_repos( r ) + # assert not t.has_in_members( u ) + # self.printList( "Team members", t.get_members(), lambda m: m.login ) + # self.printList( "Team repos", t.get_repos(), lambda r: r.name ) - t.delete() - self.printList( "Teams", o.get_teams(), lambda t: t.name ) + # t.delete() + # self.printList( "Teams", o.get_teams(), lambda t: t.name ) - def testEvents( self ): - self.printList( "User events", self.g.get_user( self.cobayeUser ).get_events(), lambda e: e.type ) - self.printList( "User public events", self.g.get_user( self.cobayeUser ).get_public_events(), lambda e: e.type ) - self.printList( "User public received events", self.g.get_user( self.cobayeUser ).get_public_received_events(), lambda e: e.type ) - self.printList( "User received events", self.g.get_user( self.cobayeUser ).get_received_events(), lambda e: e.type ) + # def testEvents( self ): + # self.printList( "User events", self.g.get_user( self.cobayeUser ).get_events(), lambda e: e.type ) + # self.printList( "User public events", self.g.get_user( self.cobayeUser ).get_public_events(), lambda e: e.type ) + # self.printList( "User public received events", self.g.get_user( self.cobayeUser ).get_public_received_events(), lambda e: e.type ) + # self.printList( "User received events", self.g.get_user( self.cobayeUser ).get_received_events(), lambda e: e.type ) - self.printList( "Organization events", self.g.get_organization( self.cobayeOrganization ).get_events(), lambda e: e.type ) + # self.printList( "Organization events", self.g.get_organization( self.cobayeOrganization ).get_events(), lambda e: e.type ) - self.printList( "User events", self.g.get_user().get_events(), lambda e: e.type ) - o = self.g.get_organization( self.cobayeOrganization ) - self.printList( "Organization events", self.g.get_user().get_organization_events( o ), lambda e: e.type ) + # self.printList( "User events", self.g.get_user().get_events(), lambda e: e.type ) + # o = self.g.get_organization( self.cobayeOrganization ) + # self.printList( "Organization events", self.g.get_user().get_organization_events( o ), lambda e: e.type ) - self.printList( "Repo events", self.g.get_user().get_repo( "TestPyGithub" ).get_events(), lambda e: e.type ) - self.printList( "Repo issues events", self.g.get_user().get_repo( "TestPyGithub" ).get_issues_events(), lambda e: e.event ) - print self.g.get_user().get_repo( "TestPyGithub" ).get_issues_event( 10693379 ).event - self.printList( "Repo network events", self.g.get_user().get_repo( "TestPyGithub" ).get_network_events(), lambda e: e.type ) + # self.printList( "Repo events", self.g.get_user().get_repo( "TestPyGithub" ).get_events(), lambda e: e.type ) + # self.printList( "Repo issues events", self.g.get_user().get_repo( "TestPyGithub" ).get_issues_events(), lambda e: e.event ) + # print self.g.get_user().get_repo( "TestPyGithub" ).get_issues_event( 10693379 ).event + # self.printList( "Repo network events", self.g.get_user().get_repo( "TestPyGithub" ).get_network_events(), lambda e: e.type ) - self.printList( "Issue events", self.g.get_user().get_repo( "TestPyGithub" ).get_issue( 23 ).get_events(), lambda e: e.event ) + # self.printList( "Issue events", self.g.get_user().get_repo( "TestPyGithub" ).get_issue( 23 ).get_events(), lambda e: e.event ) - def testFollow( self ): - cobaye = self.g.get_user( self.cobayeUser ) - u = self.g.get_user() - u.remove_from_following( cobaye ) - assert not u.has_in_following( cobaye ) - u.add_to_following( cobaye ) - assert u.has_in_following( cobaye ) - self.printList( "Following", u.get_following(), lambda f: f.login ) - self.printList( "Followers", u.get_followers(), lambda f: f.login ) + # def testFollow( self ): + # cobaye = self.g.get_user( self.cobayeUser ) + # u = self.g.get_user() + # u.remove_from_following( cobaye ) + # assert not u.has_in_following( cobaye ) + # u.add_to_following( cobaye ) + # assert u.has_in_following( cobaye ) + # self.printList( "Following", u.get_following(), lambda f: f.login ) + # self.printList( "Followers", u.get_followers(), lambda f: f.login ) - def testGists( self ): - u = self.g.get_user() - self.printList( "Gists", u.get_gists(), lambda g: g.description ) - g = u.create_gist( public = True, description = "Gist created by PyGithub", files = { "foo.bar": { "content": "This gist was created by PyGithub" } } ) - self.printList( "Gists", u.get_gists(), lambda g: g.description ) - g.edit( description = "Gist edited by PyGithub" ) - self.printList( "Gists", u.get_gists(), lambda g: g.description ) + # def testGists( self ): + # u = self.g.get_user() + # self.printList( "Gists", u.get_gists(), lambda g: g.description ) + # g = u.create_gist( public = True, description = "Gist created by PyGithub", files = { "foo.bar": { "content": "This gist was created by PyGithub" } } ) + # self.printList( "Gists", u.get_gists(), lambda g: g.description ) + # g.edit( description = "Gist edited by PyGithub" ) + # self.printList( "Gists", u.get_gists(), lambda g: g.description ) - self.printList( "Starred gists", u.get_starred_gists(), lambda g: g.description ) - g.set_starred() - assert g.is_starred() - self.printList( "Starred gists", u.get_starred_gists(), lambda g: g.description ) - g.reset_starred() - self.printList( "Starred gists", u.get_starred_gists(), lambda g: g.description ) + # self.printList( "Starred gists", u.get_starred_gists(), lambda g: g.description ) + # g.set_starred() + # assert g.is_starred() + # self.printList( "Starred gists", u.get_starred_gists(), lambda g: g.description ) + # g.reset_starred() + # self.printList( "Starred gists", u.get_starred_gists(), lambda g: g.description ) - self.printList( "Gist comments", g.get_comments(), lambda c: c.body ) - c = g.create_comment( "Comment created by PyGithub" ) - self.printList( "Gist comments", g.get_comments(), lambda c: c.body ) - c.edit( "Comment edited by PyGithub" ) - self.printList( "Gist comments", g.get_comments(), lambda c: c.body ) - sameComment = g.get_comment( c.id ) - c.delete() - self.printList( "Gist comments", g.get_comments(), lambda c: c.body ) + # self.printList( "Gist comments", g.get_comments(), lambda c: c.body ) + # c = g.create_comment( "Comment created by PyGithub" ) + # self.printList( "Gist comments", g.get_comments(), lambda c: c.body ) + # c.edit( "Comment edited by PyGithub" ) + # self.printList( "Gist comments", g.get_comments(), lambda c: c.body ) + # sameComment = g.get_comment( c.id ) + # c.delete() + # self.printList( "Gist comments", g.get_comments(), lambda c: c.body ) - otherGist = self.g.get_gist( 1965703 ).create_fork() # Origin gist picked up randomly - self.printList( "Gists", u.get_gists(), lambda g: g.description or "None" ) - otherGist.delete() - self.printList( "Gists", u.get_gists(), lambda g: g.description ) + # otherGist = self.g.get_gist( 1965703 ).create_fork() # Origin gist picked up randomly + # self.printList( "Gists", u.get_gists(), lambda g: g.description or "None" ) + # otherGist.delete() + # self.printList( "Gists", u.get_gists(), lambda g: g.description ) - g.delete() - self.printList( "Gists", u.get_gists(), lambda g: g.description ) + # g.delete() + # self.printList( "Gists", u.get_gists(), lambda g: g.description ) - def testGistsAll( self ): - self.printList( "Gists", self.g.get_gists(), lambda g: g.description ) + # def testGistsAll( self ): + # self.printList( "Gists", self.g.get_gists(), lambda g: g.description ) - def testGitObjects( self ): - o = self.g.get_organization( self.cobayeOrganization ) - r = o.get_repo( "TestPyGithub" ) + # def testGitObjects( self ): + # o = self.g.get_organization( self.cobayeOrganization ) + # r = o.get_repo( "TestPyGithub" ) - masterRef = r.get_git_ref( "refs/heads/master" ) - masterCommit = r.get_git_commit( masterRef.object[ "sha" ] ) - masterTree = r.get_git_tree( masterCommit.tree.sha ) - readmeBlob = None - for element in masterTree.tree: - if element[ "path" ] == "ReadMe.md": - readmeBlob = r.get_git_blob( element[ "sha" ] ) - break + # masterRef = r.get_git_ref( "refs/heads/master" ) + # masterCommit = r.get_git_commit( masterRef.object[ "sha" ] ) + # masterTree = r.get_git_tree( masterCommit.tree.sha ) + # readmeBlob = None + # for element in masterTree.tree: + # if element[ "path" ] == "ReadMe.md": + # readmeBlob = r.get_git_blob( element[ "sha" ] ) + # break - blob = r.create_git_blob( "This blob was created by PyGithub", encoding = "latin1" ) - tree = r.create_git_tree( [ { "path": "foo.bar", "mode": "100644", "type": "blob", "sha": blob.sha }, { "path": "ReadMe.md", "mode": "100644", "type": "blob", "sha": readmeBlob.sha } ] ) - commit = r.create_git_commit( "This commit was created by PyGithub", tree.sha, [ masterCommit.sha ] ) - r.create_git_ref( "refs/heads/previous_master", masterRef.object[ "sha" ] ) - masterRef.edit( commit.sha ) + # blob = r.create_git_blob( "This blob was created by PyGithub", encoding = "latin1" ) + # tree = r.create_git_tree( [ { "path": "foo.bar", "mode": "100644", "type": "blob", "sha": blob.sha }, { "path": "ReadMe.md", "mode": "100644", "type": "blob", "sha": readmeBlob.sha } ] ) + # commit = r.create_git_commit( "This commit was created by PyGithub", tree.sha, [ masterCommit.sha ] ) + # r.create_git_ref( "refs/heads/previous_master", masterRef.object[ "sha" ] ) + # masterRef.edit( commit.sha ) - tag = r.create_git_tag( "tagCreatedByPyGithub", "This tag was created by PyGithub", commit.sha, "commit" ) - r.create_git_ref( "refs/tags/tagCreatedByPyGithub", tag.sha ) - reTag = r.get_git_tag( tag.sha ) + # tag = r.create_git_tag( "tagCreatedByPyGithub", "This tag was created by PyGithub", commit.sha, "commit" ) + # r.create_git_ref( "refs/tags/tagCreatedByPyGithub", tag.sha ) + # reTag = r.get_git_tag( tag.sha ) - def testGitObjectsAlternative( self ): - o = self.g.get_organization( self.cobayeOrganization ) - r = o.get_repo( "TestPyGithub" ) + # def testGitObjectsAlternative( self ): + # o = self.g.get_organization( self.cobayeOrganization ) + # r = o.get_repo( "TestPyGithub" ) - masterRef = r.get_git_ref( "refs/heads/master" ) - masterCommit = r.get_git_commit( masterRef.object[ "sha" ] ) - masterTree = r.get_git_tree( masterCommit.tree.sha, recursive = True ) + # masterRef = r.get_git_ref( "refs/heads/master" ) + # masterCommit = r.get_git_commit( masterRef.object[ "sha" ] ) + # masterTree = r.get_git_tree( masterCommit.tree.sha, recursive = True ) - blob = r.create_git_blob( "This blob was also created by PyGithub", encoding = "latin1" ) - tree = r.create_git_tree( [ { "path": "new.bar", "mode": "100644", "type": "blob", "sha": blob.sha } ], base_tree = masterTree.sha ) + # blob = r.create_git_blob( "This blob was also created by PyGithub", encoding = "latin1" ) + # tree = r.create_git_tree( [ { "path": "new.bar", "mode": "100644", "type": "blob", "sha": blob.sha } ], base_tree = masterTree.sha ) - def testHooks( self ): - u = self.g.get_user() - r = u.get_repo( "TestPyGithub" ) + # def testHooks( self ): + # u = self.g.get_user() + # r = u.get_repo( "TestPyGithub" ) - self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) ) - h = r.create_hook( "web", { "url": "http://www.invalid.org" } ) - self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) ) - h.edit( "web", { "url": "http://www.postbin.org/w5cgjr" } ) - self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) ) + # self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) ) + # h = r.create_hook( "web", { "url": "http://www.invalid.org" } ) + # self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) ) + # h.edit( "web", { "url": "http://www.postbin.org/w5cgjr" } ) + # self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) ) - sameHook = r.get_hook( h.id ) + # sameHook = r.get_hook( h.id ) - h.test() + # h.test() - h.delete() - self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) ) + # h.delete() + # self.printList( "Hooks", r.get_hooks(), lambda h: h.name + str( h.config ) ) - def testIssuesAndMilestones( self ): - u = self.g.get_user() - r = u.get_repo( "TestPyGithub" ) + # def testIssuesAndMilestones( self ): + # u = self.g.get_user() + # r = u.get_repo( "TestPyGithub" ) - self.printList( "Issues", r.get_issues(), lambda i: i.title ) - i = r.create_issue( "Issue created by PyGithub" ) - self.printList( "Issues", r.get_issues(), lambda i: i.title ) - i.edit( body = "Issue edited by PyGithub" ) + # self.printList( "Issues", r.get_issues(), lambda i: i.title ) + # i = r.create_issue( "Issue created by PyGithub" ) + # self.printList( "Issues", r.get_issues(), lambda i: i.title ) + # i.edit( body = "Issue edited by PyGithub" ) - self.printList( "Comments on issue", i.get_comments(), lambda c: c.body ) - c = i.create_comment( "Comment created by PyGithub" ) - self.printList( "Comments on issue", i.get_comments(), lambda c: c.body ) - c.edit( "Comment edited by PyGithub" ) - sameComment = i.get_comment( c.id ) - self.printList( "Comments on issue", i.get_comments(), lambda c: c.body ) - c.delete() - self.printList( "Comments on issue", i.get_comments(), lambda c: c.body ) + # self.printList( "Comments on issue", i.get_comments(), lambda c: c.body ) + # c = i.create_comment( "Comment created by PyGithub" ) + # self.printList( "Comments on issue", i.get_comments(), lambda c: c.body ) + # c.edit( "Comment edited by PyGithub" ) + # sameComment = i.get_comment( c.id ) + # self.printList( "Comments on issue", i.get_comments(), lambda c: c.body ) + # c.delete() + # self.printList( "Comments on issue", i.get_comments(), lambda c: c.body ) - self.printList( "Milestones", r.get_milestones(), lambda m: m.title ) - m = r.create_milestone( "Milestone created by PyGithub" ) - self.printList( "Milestones", r.get_milestones(), lambda m: m.title ) - m.edit( title = "Milestone edited by PyGithub" ) - self.printList( "Milestones", r.get_milestones(), lambda m: m.title ) + # self.printList( "Milestones", r.get_milestones(), lambda m: m.title ) + # m = r.create_milestone( "Milestone created by PyGithub" ) + # self.printList( "Milestones", r.get_milestones(), lambda m: m.title ) + # m.edit( title = "Milestone edited by PyGithub" ) + # self.printList( "Milestones", r.get_milestones(), lambda m: m.title ) - self.printList( "Issues of milestone", r.get_issues( milestone = m.number ), lambda i: i.title ) - i.edit( milestone = m.number ) - self.printList( "Issues of milestone", r.get_issues( milestone = m.number ), lambda i: i.title ) + # self.printList( "Issues of milestone", r.get_issues( milestone = m.number ), lambda i: i.title ) + # i.edit( milestone = m.number ) + # self.printList( "Issues of milestone", r.get_issues( milestone = m.number ), lambda i: i.title ) - self.printList( "Repository labels", r.get_labels(), lambda l: l.name ) - labelD = r.create_label( "D", "FF0000" ) - self.printList( "Repository labels", r.get_labels(), lambda l: l.name ) - labelD.edit( "Dada", "00FF00" ) - self.printList( "Repository labels", r.get_labels(), lambda l: l.name ) - labelD.delete() - self.printList( "Repository labels", r.get_labels(), lambda l: l.name ) + # self.printList( "Repository labels", r.get_labels(), lambda l: l.name ) + # labelD = r.create_label( "D", "FF0000" ) + # self.printList( "Repository labels", r.get_labels(), lambda l: l.name ) + # labelD.edit( "Dada", "00FF00" ) + # self.printList( "Repository labels", r.get_labels(), lambda l: l.name ) + # labelD.delete() + # self.printList( "Repository labels", r.get_labels(), lambda l: l.name ) - labelA = r.get_label( "bug" ) - labelB = r.get_label( "duplicate" ) - labelC = r.get_label( "invalid" ) + # labelA = r.get_label( "bug" ) + # labelB = r.get_label( "duplicate" ) + # labelC = r.get_label( "invalid" ) - self.printList( "Labels", i.get_labels(), lambda l: l.name ) - i.set_labels( labelA, labelB ) - self.printList( "Labels", i.get_labels(), lambda l: l.name ) - i.remove_from_labels( labelB ) - self.printList( "Labels", i.get_labels(), lambda l: l.name ) - i.delete_labels() - self.printList( "Labels", i.get_labels(), lambda l: l.name ) - i.add_to_labels( labelB, labelC ) - self.printList( "Labels", i.get_labels(), lambda l: l.name ) + # self.printList( "Labels", i.get_labels(), lambda l: l.name ) + # i.set_labels( labelA, labelB ) + # self.printList( "Labels", i.get_labels(), lambda l: l.name ) + # i.remove_from_labels( labelB ) + # self.printList( "Labels", i.get_labels(), lambda l: l.name ) + # i.delete_labels() + # self.printList( "Labels", i.get_labels(), lambda l: l.name ) + # i.add_to_labels( labelB, labelC ) + # self.printList( "Labels", i.get_labels(), lambda l: l.name ) - self.printList( "Milestone labels", r.get_milestone( m.number ).get_labels(), lambda l: l.name ) + # self.printList( "Milestone labels", r.get_milestone( m.number ).get_labels(), lambda l: l.name ) - m.delete() - self.printList( "Milestones", r.get_milestones(), lambda m: m.title ) + # m.delete() + # self.printList( "Milestones", r.get_milestones(), lambda m: m.title ) - def testIssuesForAuthenticatedUser( self ): - self.printList( "Issues", self.g.get_user().get_issues(), lambda i: i.title ) + # def testIssuesForAuthenticatedUser( self ): + # self.printList( "Issues", self.g.get_user().get_issues(), lambda i: i.title ) - def testKeys( self ): - u = self.g.get_user() - self.printList( "Keys", u.get_keys(), lambda k: k.title ) - k = u.create_key( u.login + "@PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvborozfBBn2a+JETqPekTWZ1tmYjpfH9wTKFPLjIXQmxXjNye6HVgvi+iMI436RdoLsPEFDe3cjrQ6CJa7KzhRJKNTPh5EZbKI13CXfMGr7V1i3tOokXBFSRQKnDx2dj2hnswqxGUk2jXpgC/KA1q71yqnL45CBlWr50eDpwUIEPnmqSrPpRV/0ZGwIlh4o7+6HwPUF9aBhWj945WSkjZubR4UFWlDZl7ROafpkJHs2cQzaxtmBOZnu6dzmfyro0zJsvhZKD2K6d9eKgpDeKaw5rWr6FeOZPd4xyDaV1gctG0YEui8uuSPKhpcykgREUAFf+vmOKt+yXnOoq8P4vIQ==" ) - self.printList( "Keys", u.get_keys(), lambda k: k.title ) - k.edit( title = u.login + "@PyGithub2" ) - k = u.get_key( k.id ) - self.printList( "Keys", u.get_keys(), lambda k: k.title ) - k.delete() - self.printList( "Keys", u.get_keys(), lambda k: k.title ) + # def testKeys( self ): + # u = self.g.get_user() + # self.printList( "Keys", u.get_keys(), lambda k: k.title ) + # k = u.create_key( u.login + "@PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvborozfBBn2a+JETqPekTWZ1tmYjpfH9wTKFPLjIXQmxXjNye6HVgvi+iMI436RdoLsPEFDe3cjrQ6CJa7KzhRJKNTPh5EZbKI13CXfMGr7V1i3tOokXBFSRQKnDx2dj2hnswqxGUk2jXpgC/KA1q71yqnL45CBlWr50eDpwUIEPnmqSrPpRV/0ZGwIlh4o7+6HwPUF9aBhWj945WSkjZubR4UFWlDZl7ROafpkJHs2cQzaxtmBOZnu6dzmfyro0zJsvhZKD2K6d9eKgpDeKaw5rWr6FeOZPd4xyDaV1gctG0YEui8uuSPKhpcykgREUAFf+vmOKt+yXnOoq8P4vIQ==" ) + # self.printList( "Keys", u.get_keys(), lambda k: k.title ) + # k.edit( title = u.login + "@PyGithub2" ) + # k = u.get_key( k.id ) + # self.printList( "Keys", u.get_keys(), lambda k: k.title ) + # k.delete() + # self.printList( "Keys", u.get_keys(), lambda k: k.title ) - def testMergePullRequest( self ): - r = self.g.get_user().get_repo( "TestPyGithub" ) - p = r.get_pull( 26 ) - assert not p.is_merged() - p.merge() - assert p.is_merged() + # def testMergePullRequest( self ): + # r = self.g.get_user().get_repo( "TestPyGithub" ) + # p = r.get_pull( 26 ) + # assert not p.is_merged() + # p.merge() + # assert p.is_merged() def testNamedUserDetails( self ): u = self.g.get_user( "jacquev6" ) @@ -526,74 +540,74 @@ class IntegrationTest: o = self.g.get_organization( "github" ) print o.login, "(" + o.name + ") is in", o.location - def testPullRequest( self ): - r = self.g.get_user().get_repo( "TestPyGithub" ) - self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) - p1 = r.create_pull( "Pull request created by PyGithub", "", "master", "BeaverSoftware:master" ) - self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) - p1.edit( state = "closed" ) - self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) - p2 = r.create_pull( "Pull request also created by PyGithub", "", "master", "BeaverSoftware:master" ) - self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) - self.printList( "Files", p2.get_files(), lambda f: f.filename ) - self.printList( "Commits", p2.get_commits(), lambda c: c.commit.message ) - self.printList( "Comments", p2.get_comments(), lambda c: c.body ) - com = p2.create_comment( "Comment created by PyGithub", "e4e84560cb5e87f3c0e9f710dae1ddab0eef487b", "foo.bar", 1 ) - self.printList( "Comments", p2.get_comments(), lambda c: c.body ) - com.edit( body = "Comment edited by PyGithub" ) - self.printList( "Comments", p2.get_comments(), lambda c: c.body ) - sameCom = p2.get_comment( com.id ) - sameCom.delete() - self.printList( "Comments", p2.get_comments(), lambda c: c.body ) - p2.edit( state = "closed" ) - self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) + # def testPullRequest( self ): + # r = self.g.get_user().get_repo( "TestPyGithub" ) + # self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) + # p1 = r.create_pull( "Pull request created by PyGithub", "", "master", "BeaverSoftware:master" ) + # self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) + # p1.edit( state = "closed" ) + # self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) + # p2 = r.create_pull( "Pull request also created by PyGithub", "", "master", "BeaverSoftware:master" ) + # self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) + # self.printList( "Files", p2.get_files(), lambda f: f.filename ) + # self.printList( "Commits", p2.get_commits(), lambda c: c.commit.message ) + # self.printList( "Comments", p2.get_comments(), lambda c: c.body ) + # com = p2.create_comment( "Comment created by PyGithub", "e4e84560cb5e87f3c0e9f710dae1ddab0eef487b", "foo.bar", 1 ) + # self.printList( "Comments", p2.get_comments(), lambda c: c.body ) + # com.edit( body = "Comment edited by PyGithub" ) + # self.printList( "Comments", p2.get_comments(), lambda c: c.body ) + # sameCom = p2.get_comment( com.id ) + # sameCom.delete() + # self.printList( "Comments", p2.get_comments(), lambda c: c.body ) + # p2.edit( state = "closed" ) + # self.printList( "Pull requests", r.get_pulls(), lambda p: p.title ) - def testRepositoryCompare( self ): - r = self.g.get_user().get_repo( "PyGithub" ) - print str( r.compare( "master", "develop" ) )[ :100 ] + # def testRepositoryCompare( self ): + # r = self.g.get_user().get_repo( "PyGithub" ) + # print str( r.compare( "master", "develop" ) )[ :100 ] - def testRepositoryDetails( self ): - r1 = self.g.get_user().get_repo( "PyGithub" ) - r2 = self.g.get_user().get_repo( "TestPyGithub" ) - self.printList( "Branches", r1.get_branches(), lambda b: b.name ) - self.printList( "Comments", r2.get_comments(), lambda c: c.body ) - r2.get_comment( r2.get_comments()[ 0 ].id ) - self.printList( "Contributors", r1.get_contributors(), lambda m: m.login ) - self.printList( "Forks", r2.get_forks(), lambda r: r.owner.login ) - print "Languages:", r1.get_languages() - self.printList( "Tags", r1.get_tags(), lambda t: t.name ) - self.printList( "Watchers", r1.get_watchers(), lambda m: m.login ) + # def testRepositoryDetails( self ): + # r1 = self.g.get_user().get_repo( "PyGithub" ) + # r2 = self.g.get_user().get_repo( "TestPyGithub" ) + # self.printList( "Branches", r1.get_branches(), lambda b: b.name ) + # self.printList( "Comments", r2.get_comments(), lambda c: c.body ) + # r2.get_comment( r2.get_comments()[ 0 ].id ) + # self.printList( "Contributors", r1.get_contributors(), lambda m: m.login ) + # self.printList( "Forks", r2.get_forks(), lambda r: r.owner.login ) + # print "Languages:", r1.get_languages() + # self.printList( "Tags", r1.get_tags(), lambda t: t.name ) + # self.printList( "Watchers", r1.get_watchers(), lambda m: m.login ) - r3 = self.g.get_organization( "BeaverSoftware" ).get_repo( "TestPyGithub" ) - self.printList( "Teams", r3.get_teams(), lambda t: t.name ) + # r3 = self.g.get_organization( "BeaverSoftware" ).get_repo( "TestPyGithub" ) + # self.printList( "Teams", r3.get_teams(), lambda t: t.name ) - def testRepositoryKeys( self ): - r = self.g.get_user().get_repo( "TestPyGithub" ) - self.printList( "Keys", r.get_keys(), lambda k: k.title ) - k = r.create_key( "Key created by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvborozfBBn2a+JETqPekTWZ1tmYjpfH9wTKFPLjIXQmxXjNye6HVgvi+iMI436RdoLsPEFDe3cjrQ6CJa7KzhRJKNTPh5EZbKI13CXfMGr7V1i3tOokXBFSRQKnDx2dj2hnswqxGUk2jXpgC/KA1q71yqnL45CBlWr50eDpwUIEPnmqSrPpRV/0ZGwIlh4o7+6HwPUF9aBhWj945WSkjZubR4UFWlDZl7ROafpkJHs2cQzaxtmBOZnu6dzmfyro0zJsvhZKD2K6d9eKgpDeKaw5rWr6FeOZPd4xyDaV1gctG0YEui8uuSPKhpcykgREUAFf+vmOKt+yXnOoq8P4vIQ==" ) - self.printList( "Keys", r.get_keys(), lambda k: k.title ) - k.edit( "Key edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvborozfBBn2a+JETqPekTWZ1tmYjpfH9wTKFPLjIXQmxXjNye6HVgvi+iMI436RdoLsPEFDe3cjrQ6CJa7KzhRJKNTPh5EZbKI13CXfMGr7V1i3tOokXBFSRQKnDx2dj2hnswqxGUk2jXpgC/KA1q71yqnL45CBlWr50eDpwUIEPnmqSrPpRV/0ZGwIlh4o7+6HwPUF9aBhWj945WSkjZubR4UFWlDZl7ROafpkJHs2cQzaxtmBOZnu6dzmfyro0zJsvhZKD2K6d9eKgpDeKaw5rWr6FeOZPd4xyDaV1gctG0YEui8uuSPKhpcykgREUAFf+vmOKt+yXnOoq8P4vIQ==" ) - self.printList( "Keys", r.get_keys(), lambda k: k.title ) - sameKey = r.get_key( k.id ) - sameKey.delete() - self.printList( "Keys", r.get_keys(), lambda k: k.title ) + # def testRepositoryKeys( self ): + # r = self.g.get_user().get_repo( "TestPyGithub" ) + # self.printList( "Keys", r.get_keys(), lambda k: k.title ) + # k = r.create_key( "Key created by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvborozfBBn2a+JETqPekTWZ1tmYjpfH9wTKFPLjIXQmxXjNye6HVgvi+iMI436RdoLsPEFDe3cjrQ6CJa7KzhRJKNTPh5EZbKI13CXfMGr7V1i3tOokXBFSRQKnDx2dj2hnswqxGUk2jXpgC/KA1q71yqnL45CBlWr50eDpwUIEPnmqSrPpRV/0ZGwIlh4o7+6HwPUF9aBhWj945WSkjZubR4UFWlDZl7ROafpkJHs2cQzaxtmBOZnu6dzmfyro0zJsvhZKD2K6d9eKgpDeKaw5rWr6FeOZPd4xyDaV1gctG0YEui8uuSPKhpcykgREUAFf+vmOKt+yXnOoq8P4vIQ==" ) + # self.printList( "Keys", r.get_keys(), lambda k: k.title ) + # k.edit( "Key edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvborozfBBn2a+JETqPekTWZ1tmYjpfH9wTKFPLjIXQmxXjNye6HVgvi+iMI436RdoLsPEFDe3cjrQ6CJa7KzhRJKNTPh5EZbKI13CXfMGr7V1i3tOokXBFSRQKnDx2dj2hnswqxGUk2jXpgC/KA1q71yqnL45CBlWr50eDpwUIEPnmqSrPpRV/0ZGwIlh4o7+6HwPUF9aBhWj945WSkjZubR4UFWlDZl7ROafpkJHs2cQzaxtmBOZnu6dzmfyro0zJsvhZKD2K6d9eKgpDeKaw5rWr6FeOZPd4xyDaV1gctG0YEui8uuSPKhpcykgREUAFf+vmOKt+yXnOoq8P4vIQ==" ) + # self.printList( "Keys", r.get_keys(), lambda k: k.title ) + # sameKey = r.get_key( k.id ) + # sameKey.delete() + # self.printList( "Keys", r.get_keys(), lambda k: k.title ) - def testWatch( self ): - r = self.g.get_user( "jacquev6" ).get_repo( "PyGithub" ) - u = self.g.get_user() - u.remove_from_watched( r ) - assert not u.has_in_watched( r ) - u.add_to_watched( r ) - assert u.has_in_watched( r ) - self.printList( "Watched", u.get_watched(), lambda r: r.name ) + # def testWatch( self ): + # r = self.g.get_user( "jacquev6" ).get_repo( "PyGithub" ) + # u = self.g.get_user() + # u.remove_from_watched( r ) + # assert not u.has_in_watched( r ) + # u.add_to_watched( r ) + # assert u.has_in_watched( r ) + # self.printList( "Watched", u.get_watched(), lambda r: r.name ) - def testEmails( self ): - u = self.g.get_user() - self.printList( "Emails", u.get_emails() ) - u.add_to_emails( "ab@xxx.com", "cd@xxx.com" ) - self.printList( "Emails", u.get_emails() ) - u.remove_from_emails( "ab@xxx.com", "cd@xxx.com" ) - self.printList( "Emails", u.get_emails() ) + # def testEmails( self ): + # u = self.g.get_user() + # self.printList( "Emails", u.get_emails() ) + # u.add_to_emails( "ab@xxx.com", "cd@xxx.com" ) + # self.printList( "Emails", u.get_emails() ) + # u.remove_from_emails( "ab@xxx.com", "cd@xxx.com" ) + # self.printList( "Emails", u.get_emails() ) def printList( self, title, iterable, f = lambda x: x ): print title + ":", ", ".join( str( f( x ) ) for x in iterable[ :10 ] ), "..." if len( iterable ) > 10 else "" diff --git a/JsonDescriptionOfGithubApiV3/description.000.human_readable.json b/JsonDescriptionOfGithubApiV3/description.000.human_readable.json new file mode 100644 index 00000000..988afba2 --- /dev/null +++ b/JsonDescriptionOfGithubApiV3/description.000.human_readable.json @@ -0,0 +1,1545 @@ +{ + "classes": [ + { + "name": "AuthenticatedUser", + "identity": [ { "type": "attribute", "value": [ "login" ] } ], + "base_url": [ { "type": "constant", "value": "/user" } ], + "edit": { + "optional_parameters": [ + { "name": "name", "type": "string" }, + { "name": "email", "type": "string" }, + { "name": "blog", "type": "string" }, + { "name": "company", "type": "string" }, + { "name": "location", "type": "string" }, + { "name": "hireable", "type": "bool" }, + { "name": "bio", "type": "string" } + ] + }, + "attributes": [ + { "name": "avatar_url", "type": "@todo" }, + { "name": "bio", "type": "@todo" }, + { "name": "blog", "type": "@todo" }, + { "name": "collaborators", "type": "@todo" }, + { "name": "company", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "disk_usage", "type": "@todo" }, + { "name": "email", "type": "@todo" }, + { "name": "followers", "type": "@todo" }, + { "name": "following", "type": "@todo" }, + { "name": "gravatar_id", "type": "@todo" }, + { "name": "hireable", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "location", "type": "string" }, + { "name": "login", "type": "string", "identifying": true }, + { "name": "name", "type": "string" }, + { "name": "owned_private_repos", "type": "@todo" }, + { "name": "plan", "type": "@todo" }, + { "name": "private_gists", "type": "@todo" }, + { "name": "public_gists", "type": "@todo" }, + { "name": "public_repos", "type": "@todo" }, + { "name": "total_private_repos", "type": "@todo" }, + { "name": "type", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + { + "name": "authorizations", + "singular_name": "authorization", + "type": "Authorization", + "create_element": { + "optional_parameters": [ + { "name": "scopes", "type": "@todo" }, + { "name": "note", "type": "@todo" }, + { "name": "note_url", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + }, + "get_list": true + }, + { + "name": "events", + "singular_name": "event", + "type": "Event", + "get_list": true + }, + { + "name": "issues", + "singular_name": "issue", + "type": "Issue", + "get_list": true + }, + { + "name": "keys", + "singular_name": "key", + "type": "UserKey", + "get_list": true, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "title", "type": "@todo" }, + { "name": "key", "type": "@todo" } + ] + } + }, + { + "name": "repos", + "singular_name": "repo", + "type": "Repository", + "get_list": { + "optional_parameters": [ + { "name": "type", "type": "enum", "values": [ "@todo" ] } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "name", "type": "string" } + ], + "automatic_parameters": [ + { "name": "owner", "source": [ { "type": "attribute", "value": [] } ] } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "name", "type": "string" } + ], + "optional_parameters": [ + { "name": "description", "type": "string" }, + { "name": "homepage", "type": "string" }, + { "name": "private", "type": "bool" }, + { "name": "has_issues", "type": "bool" }, + { "name": "has_wiki", "type": "bool" }, + { "name": "has_downloads", "type": "bool" }, + { "name": "team_id", "type": "int", "@todo": "Use Team" } + ] + } + }, + { + "name": "emails", + "singular_name": "email", + "type": "string", + "get_list": true, + "add_several_elements": true, + "remove_several_elements": true + }, + { + "name": "watched", + "singular_name": "watched", + "type": "Repository", + "get_list": true, + "has_element": true, + "add_element": true, + "remove_element": true + }, + { + "name": "following", + "singular_name": "following", + "type": "NamedUser", + "get_list": true, + "remove_element": true, + "has_element": true, + "add_element": true + }, + { + "name": "followers", + "singular_name": "follower", + "type": "NamedUser", + "get_list": true + }, + { + "name": "orgs", + "singular_name": "org", + "type": "Organization", + "get_list": true + }, + { + "name": "gists", + "singular_name": "gist", + "type": "Gist", + "special_url": "/gists", + "get_list": true, + "create_element": { + "mandatory_parameters": [ + { "name": "public", "type": "bool" }, + { "name": "files", "type": "dict" } + ], + "optional_parameters": [ + { "name": "description", "type": "string" } + ] + } + } + ], + "additional_methods": [ + { + "name": [ "create", "fork" ], + "group": "forking", + "type": "Repository", + "mandatory_parameters": [ + { "name": "repo", "type": "Repository" } + ], + "request": { + "verb": "POST", + "url": [ + { "type": "constant", "value": "/repos/" }, + { "type": "argument", "value": [ "repo", "owner", "login" ] }, + { "type": "constant", "value": "/" }, + { "type": "argument", "value": [ "repo", "name" ] }, + { "type": "constant", "value": "/forks" } + ] + } + }, + { + "name": [ "get", "organization", "events" ], + "group": "events", + "type": { "cardinality": "list", "name": "Event" }, + "mandatory_parameters": [ + { "name": "org", "type": "@todo" } + ] + }, + { + "name": [ "get", "starred", "gists" ], + "group": "gists", + "type": { "cardinality": "list", "name": "Gist" } + } + ] + }, + { + "name": "Authorization", + "edit": { + "optional_parameters": [ + { "name": "scopes", "type": "@todo" }, + { "name": "add_scopes", "type": "@todo" }, + { "name": "remove_scopes", "type": "@todo" }, + { "name": "note", "type": "@todo" }, + { "name": "note_url", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "app", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "note_url", "type": "@todo" }, + { "name": "note", "type": "@todo" }, + { "name": "scopes", "type": "@todo" }, + { "name": "token", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "Branch", + "attributes": [ + { "name": "name", "type": "string", "mandatory": true }, + { "name": "commit", "type": "Commit" } + ], + "collections": [ + ] + }, + { + "name": "Commit", + "attributes": [ + { "name": "files", "type": "dict", "@todo": "dict of what?" }, + { "name": "parents", "type": "list", "@todo": "list of what?" }, + { "name": "sha", "type": "string" }, + { "name": "stats", "type": "dict", "@todo": "dict of what?" }, + { "name": "url", "type": "string" }, + { "name": "author", "type": "NamedUser" }, + { "name": "committer", "type": "NamedUser" }, + { "name": "commit", "type": "GitCommit" } + ], + "collections": [ + { + "name": "comments", + "singular_name": "comment", + "type": "CommitComment", + "get_list": true, + "create_element": { + "mandatory_parameters": [ + { "name": "body", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "commit_id", "type": "@todo" }, + { "name": "line", "type": "@todo" }, + { "name": "path", "type": "@todo" }, + { "name": "position", "type": "@todo" } + ] + } + } + ] + }, + { + "name": "CommitComment", + "edit": { + "mandatory_parameters": [ + { "name": "body", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "body", "type": "@todo" }, + { "name": "commit_id", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "line", "type": "@todo" }, + { "name": "path", "type": "@todo" }, + { "name": "position", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "user", "type": "NamedUser" } + ], + "collections": [ + ] + }, + { + "name": "Download", + "delete": true, + "attributes": [ + { "name": "accesskeyid", "type": "@todo" }, + { "name": "acl", "type": "@todo" }, + { "name": "bucket", "type": "@todo" }, + { "name": "content_type", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "description", "type": "@todo" }, + { "name": "download_count", "type": "@todo" }, + { "name": "expirationdate", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "mime_type", "type": "@todo" }, + { "name": "name", "type": "@todo" }, + { "name": "path", "type": "@todo" }, + { "name": "policy", "type": "@todo" }, + { "name": "prefix", "type": "@todo" }, + { "name": "redirect", "type": "@todo" }, + { "name": "s3_url", "type": "@todo" }, + { "name": "signature", "type": "@todo" }, + { "name": "size", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "Event", + "attributes": [ + { "name": "commit_id", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "event", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "issue", "type": "@todo" }, + { "name": "payload", "type": "@todo" }, + { "name": "public", "type": "@todo" }, + { "name": "type", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "actor", "type": "NamedUser" }, + { "name": "org", "type": "Organization" }, + { "name": "repo", "type": "Repository" } + ], + "collections": [ + ] + }, + { + "name": "Gist", + "base_url": [ { "type": "constant", "value": "/gists/" }, { "type": "attribute", "value": [ "id" ] } ], + "edit": { + "optional_parameters": [ + { "name": "description", "type": "string" }, + { "name": "files", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "comments", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "description", "type": "string" }, + { "name": "files", "type": "@todo" }, + { "name": "forks", "type": "@todo" }, + { "name": "git_pull_url", "type": "@todo" }, + { "name": "git_push_url", "type": "@todo" }, + { "name": "history", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "integer", "mandatory": true }, + { "name": "public", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "user", "type": "NamedUser" } + ], + "collections": [ + { + "name": "comments", + "singular_name": "comment", + "type": "GistComment", + "get_list": true, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "body", "type": "@todo" } + ] + } + } + ], + "additional_methods": [ + { + "name": [ "is", "starred" ], + "group": "starring", + "type": "bool" + }, + { + "name": [ "reset", "starred" ], + "group": "starring", + "type": "void" + }, + { + "name": [ "set", "starred" ], + "group": "starring", + "type": "void" + }, + { + "name": [ "create", "fork" ], + "group": "forking", + "type": "Gist" + } + ] + }, + { + "name": "GistComment", + "edit": { + "mandatory_parameters": [ + { "name": "body", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "body", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "user", "type": "NamedUser" } + ], + "collections": [ + ] + }, + { + "name": "GitBlob", + "attributes": [ + { "name": "content", "type": "@todo" }, + { "name": "encoding", "type": "@todo" }, + { "name": "sha", "type": "@todo" }, + { "name": "size", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "GitCommit", + "attributes": [ + { "name": "author", "type": "@todo" }, + { "name": "committer", "type": "@todo" }, + { "name": "message", "type": "@todo" }, + { "name": "parents", "type": "@todo" }, + { "name": "sha", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "tree", "type": "GitTree" } + ], + "collections": [ + ] + }, + { + "name": "GitRef", + "edit": { + "mandatory_parameters": [ + { "name": "sha", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "force", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "object", "type": "@todo" }, + { "name": "ref", "type": "string", "mandatory": true }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "GitTag", + "attributes": [ + { "name": "message", "type": "@todo" }, + { "name": "object", "type": "@todo" }, + { "name": "sha", "type": "@todo" }, + { "name": "tag", "type": "@todo" }, + { "name": "tagger", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "GitTree", + "attributes": [ + { "name": "recursive", "type": "@todo" }, + { "name": "sha", "type": "@todo" }, + { "name": "tree", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "Hook", + "edit": { + "mandatory_parameters": [ + { "name": "name", "type": "@todo" }, + { "name": "config", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "events", "type": "@todo" }, + { "name": "add_events", "type": "@todo" }, + { "name": "remove_events", "type": "@todo" }, + { "name": "active", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "active", "type": "@todo" }, + { "name": "config", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "events", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "last_response", "type": "@todo" }, + { "name": "name", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ], + "additional_methods": [ + { + "name": [ "test" ], + "group": "testing", + "type": "void" + } + ] + }, + { + "name": "Issue", + "edit": { + "optional_parameters": [ + { "name": "title", "type": "@todo" }, + { "name": "body", "type": "@todo" }, + { "name": "assignee", "type": "@todo" }, + { "name": "state", "type": "@todo" }, + { "name": "milestone", "type": "@todo" }, + { "name": "labels", "type": "@todo" } + ] + }, + "attributes": [ + { "name": "assignee", "type": "NamedUser" }, + { "name": "body", "type": "@todo" }, + { "name": "closed_at", "type": "@todo" }, + { "name": "closed_by", "type": "@todo" }, + { "name": "comments", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "labels", "type": "@todo" }, + { "name": "milestone", "type": "Milestone" }, + { "name": "number", "type": "@todo" }, + { "name": "pull_request", "type": "@todo" }, + { "name": "state", "type": "@todo" }, + { "name": "title", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "user", "type": "NamedUser" } + ], + "collections": [ + { + "name": "comments", + "singular_name": "comment", + "type": "IssueComment", + "get_list": true, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "body", "type": "string" } + ] + } + }, + { + "name": "events", + "singular_name": "event", + "type": "IssueEvent", + "get_list": true + }, + { + "name": "labels", + "singular_name": "label", + "type": "Label", + "get_list": true, + "add_several_elements": true, + "remove_element": true, + "set_list": true, + "delete_list": true + } + ] + }, + { + "name": "IssueComment", + "edit": { + "mandatory_parameters": [ + { "name": "body", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "body", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "user", "type": "NamedUser" } + ], + "collections": [ + ] + }, + { + "name": "IssueEvent", + "attributes": [ + { "name": "commit_id", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "event", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "issue", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "actor", "type": "NamedUser" } + ], + "collections": [ + ] + }, + { + "name": "Label", + "edit": { + "mandatory_parameters": [ + { "name": "name", "type": "@todo" }, + { "name": "color", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "color", "type": "@todo" }, + { "name": "name", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "Milestone", + "edit": { + "mandatory_parameters": [ + { "name": "title", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "state", "type": "@todo" }, + { "name": "description", "type": "@todo" }, + { "name": "due_on", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "closed_issues", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "description", "type": "@todo" }, + { "name": "due_on", "type": "@todo" }, + { "name": "number", "type": "@todo" }, + { "name": "open_issues", "type": "@todo" }, + { "name": "state", "type": "@todo" }, + { "name": "title", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "creator", "type": "NamedUser" } + ], + "collections": [ + { + "name": "labels", + "singular_name": "label", + "type": "Label", + "get_list": true + } + ] + }, + { + "name": "NamedUser", + "identity": [ { "type": "attribute", "value": [ "login" ] } ], + "base_url": [ { "type": "constant", "value": "/users/" }, { "type": "attribute", "value": [ "login" ] } ], + "attributes": [ + { "name": "avatar_url", "type": "@todo" }, + { "name": "bio", "type": "@todo" }, + { "name": "blog", "type": "@todo" }, + { "name": "collaborators", "type": "@todo" }, + { "name": "company", "type": "@todo" }, + { "name": "contributions", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "disk_usage", "type": "@todo" }, + { "name": "email", "type": "@todo" }, + { "name": "followers", "type": "integer" }, + { "name": "following", "type": "@todo" }, + { "name": "gravatar_id", "type": "@todo" }, + { "name": "hireable", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "location", "type": "string" }, + { "name": "login", "type": "string", "mandatory": true }, + { "name": "name", "type": "string" }, + { "name": "owned_private_repos", "type": "@todo" }, + { "name": "plan", "type": "@todo" }, + { "name": "private_gists", "type": "@todo" }, + { "name": "public_gists", "type": "@todo" }, + { "name": "public_repos", "type": "@todo" }, + { "name": "total_private_repos", "type": "@todo" }, + { "name": "type", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + { + "name": "events", + "singular_name": "event", + "type": "Event", + "get_list": true + }, + { + "name": "followers", + "singular_name": "follower", + "type": "NamedUser", + "get_list": true + }, + { + "name": "following", + "singular_name": "following", + "type": "NamedUser", + "get_list": true + }, + { + "name": "repos", + "singular_name": "repo", + "type": "Repository", + "get_list": { + "optional_parameters": [ + { "name": "type", "type": "enum", "values": [ "@todo" ] } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "name", "type": "string" } + ], + "automatic_parameters": [ + { "name": "owner", "source": [ { "type": "attribute", "value": [] } ] } + ] + } + }, + { + "name": "watched", + "singular_name": "watched", + "type": "Repository", + "get_list": true + }, + { + "name": "orgs", + "singular_name": "org", + "type": "Organization", + "get_list": true + }, + { + "name": "gists", + "singular_name": "gist", + "type": "Gist", + "get_list": true, + "create_element": { + "mandatory_parameters": [ + { "name": "public", "type": "bool" }, + { "name": "files", "type": "dict" } + ], + "optional_parameters": [ + { "name": "description", "type": "string" } + ] + } + } + ], + "additional_methods": [ + { + "name": [ "get", "public", "events" ], + "group": "events", + "type": { "cardinality": "list", "name": "Event" } + }, + { + "name": [ "get", "received", "events" ], + "group": "events", + "type": { "cardinality": "list", "name": "Event" } + }, + { + "name": [ "get", "public", "received", "events" ], + "group": "events", + "type": { "cardinality": "list", "name": "Event" } + } + ] + }, + { + "name": "Organization", + "base_url": [ { "type": "constant", "value": "/orgs/" }, { "type": "attribute", "value": [ "login" ] } ], + "edit": { + "optional_parameters": [ + { "name": "billing_email", "type": "@todo" }, + { "name": "blog", "type": "@todo" }, + { "name": "company", "type": "@todo" }, + { "name": "email", "type": "@todo" }, + { "name": "location", "type": "@todo" }, + { "name": "name", "type": "@todo" } + ] + }, + "attributes": [ + { "name": "avatar_url", "type": "@todo" }, + { "name": "billing_email", "type": "@todo" }, + { "name": "blog", "type": "@todo" }, + { "name": "collaborators", "type": "@todo" }, + { "name": "company", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "disk_usage", "type": "@todo" }, + { "name": "email", "type": "@todo" }, + { "name": "followers", "type": "@todo" }, + { "name": "following", "type": "@todo" }, + { "name": "gravatar_id", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "location", "type": "string" }, + { "name": "login", "type": "string", "mandatory": true }, + { "name": "name", "type": "string" }, + { "name": "owned_private_repos", "type": "@todo" }, + { "name": "plan", "type": "@todo" }, + { "name": "private_gists", "type": "@todo" }, + { "name": "public_gists", "type": "@todo" }, + { "name": "public_repos", "type": "@todo" }, + { "name": "total_private_repos", "type": "@todo" }, + { "name": "type", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + { + "name": "events", + "singular_name": "event", + "type": "Event", + "get_list": true + }, + { + "name": "members", + "singular_name": "member", + "type": "NamedUser", + "get_list": true, + "has_element": true, + "remove_element": true + }, + { + "name": "public_members", + "singular_name": "public_member", + "type": "NamedUser", + "get_list": true, + "has_element": true, + "add_element": true, + "remove_element": true + }, + { + "name": "repos", + "singular_name": "repo", + "type": "Repository", + "get_list": { + "optional_parameters": [ + { "name": "type", "type": "enum", "values": [ "@todo" ] } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "name", "type": "string" } + ], + "automatic_parameters": [ + { "name": "owner", "source": [ { "type": "attribute", "value": [] } ] } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "name", "type": "string" } + ], + "optional_parameters": [ + { "name": "description", "type": "string" }, + { "name": "homepage", "type": "string" }, + { "name": "private", "type": "bool" }, + { "name": "has_issues", "type": "bool" }, + { "name": "has_wiki", "type": "bool" }, + { "name": "has_downloads", "type": "bool" }, + { "name": "team_id", "type": "int", "@todo": "Use Team" } + ] + } + }, + { + "name": "teams", + "singular_name": "team", + "type": "Team", + "get_list": true, + "create_element": { + "mandatory_parameters": [ + { "name": "name", "type": "string" } + ], + "optional_parameters": [ + { "name": "repo_names", "type": "list" }, + { "name": "permission", "type": "enum", "values": [ "@todo" ] } + ] + } + } + ], + "additional_methods": [ + { + "name": [ "create", "fork" ], + "group": "forking", + "type": "Repository", + "mandatory_parameters": [ + { "name": "repo", "type": "Repository" } + ] + } + ] + }, + { + "name": "PullRequest", + "edit": { + "optional_parameters": [ + { "name": "title", "type": "@todo" }, + { "name": "body", "type": "@todo" }, + { "name": "state", "type": "@todo" } + ] + }, + "attributes": [ + { "name": "additions", "type": "@todo" }, + { "name": "base", "type": "@todo" }, + { "name": "body", "type": "@todo" }, + { "name": "changed_files", "type": "@todo" }, + { "name": "closed_at", "type": "@todo" }, + { "name": "comments", "type": "@todo" }, + { "name": "commits", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "deletions", "type": "@todo" }, + { "name": "diff_url", "type": "@todo" }, + { "name": "head", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "issue_url", "type": "@todo" }, + { "name": "mergeable", "type": "@todo" }, + { "name": "merged_at", "type": "@todo" }, + { "name": "merged_by", "type": "@todo" }, + { "name": "merged", "type": "@todo" }, + { "name": "number", "type": "@todo" }, + { "name": "patch_url", "type": "@todo" }, + { "name": "review_comments", "type": "@todo" }, + { "name": "state", "type": "@todo" }, + { "name": "title", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "user", "type": "NamedUser" } + ], + "collections": [ + { + "name": "comments", + "singular_name": "comment", + "type": "PullRequestComment", + "get_list": true, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + } + }, + { + "name": "commits", + "singular_name": "commit", + "type": "Commit", + "get_list": true + }, + { + "name": "files", + "singular_name": "file", + "type": "PullRequestFile", + "get_list": true + } + ], + "additional_methods": [ + { + "name": [ "is", "merged" ], + "type": "bool", + "group": "merging" + }, + { + "name": [ "merge" ], + "type": "void", + "group": "merging", + "optional_parameters": [ + { "name": "commit_message", "type": "string" } + ] + } + ] + }, + { + "name": "PullRequestComment", + "edit": { + "mandatory_parameters": [ + { "name": "body", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "body", "type": "@todo" }, + { "name": "commit_id", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "line", "type": "@todo" }, + { "name": "path", "type": "@todo" }, + { "name": "position", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "user", "type": "NamedUser" } + ], + "collections": [ + ] + }, + { + "name": "PullRequestFile", + "attributes": [ + { "name": "additions", "type": "@todo" }, + { "name": "blob_url", "type": "@todo" }, + { "name": "changes", "type": "@todo" }, + { "name": "deletions", "type": "@todo" }, + { "name": "filename", "type": "@todo" }, + { "name": "patch", "type": "@todo" }, + { "name": "raw_url", "type": "@todo" }, + { "name": "sha", "type": "@todo" }, + { "name": "status", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "Repository", + "identity": [ { "type": "attribute", "value": [ "owner", "login" ] }, { "type": "constant", "value": "/" }, { "type": "attribute", "value": [ "name" ] } ], + "base_url": [ { "type": "constant", "value": "/repos/" }, { "type": "attribute", "value": [ "_identity" ] } ], + "edit": { + "mandatory_parameters": [ + { "name": "name", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "description", "type": "@todo" }, + { "name": "homepage", "type": "@todo" }, + { "name": "public", "type": "@todo" }, + { "name": "has_issues", "type": "@todo" }, + { "name": "has_wiki", "type": "@todo" }, + { "name": "has_downloads", "type": "@todo" } + ] + }, + "attributes": [ + { "name": "clone_url", "type": "@todo" }, + { "name": "created_at", "type": "@todo" }, + { "name": "description", "type": "@todo" }, + { "name": "fork", "type": "@todo" }, + { "name": "forks", "type": "@todo" }, + { "name": "git_url", "type": "@todo" }, + { "name": "has_downloads", "type": "@todo" }, + { "name": "has_issues", "type": "@todo" }, + { "name": "has_wiki", "type": "@todo" }, + { "name": "homepage", "type": "@todo" }, + { "name": "html_url", "type": "@todo" }, + { "name": "id", "type": "@todo" }, + { "name": "language", "type": "@todo" }, + { "name": "master_branch", "type": "@todo" }, + { "name": "mirror_url", "type": "@todo" }, + { "name": "name", "type": "string", "mandatory": true }, + { "name": "open_issues", "type": "@todo" }, + { "name": "organization", "type": "@todo" }, + { "name": "owner", "type": "NamedUser", "mandatory": true }, + { "name": "parent", "type": "Repository" }, + { "name": "permissions", "type": "@todo" }, + { "name": "private", "type": "@todo" }, + { "name": "pushed_at", "type": "@todo" }, + { "name": "size", "type": "@todo" }, + { "name": "source", "type": "Repository" }, + { "name": "ssh_url", "type": "@todo" }, + { "name": "svn_url", "type": "@todo" }, + { "name": "updated_at", "type": "@todo" }, + { "name": "url", "type": "@todo" }, + { "name": "watchers", "type": "@todo" } + ], + "collections": [ + { + "name": "branches", + "singular_name": "branch", + "type": "Branch", + "get_list": true + }, + { + "name": "collaborators", + "singular_name": "collaborator", + "type": "NamedUser", + "get_list": true, + "has_element": true, + "add_element": true, + "remove_element": true + }, + { + "name": "comments", + "singular_name": "comment", + "type": "CommitComment", + "get_list": true, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + } + }, + { + "name": "commits", + "singular_name": "commit", + "type": "Commit", + "get_list": { + "optional_parameters": [ + { "name": "sha", "type": "@todo" }, + { "name": "path", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "sha", "type": "@todo" } + ] + } + }, + { + "name": "contributors", + "singular_name": "contributor", + "type": "NamedUser", + "get_list": true + }, + { + "name": "downloads", + "singular_name": "download", + "type": "Download", + "get_list": true, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "name", "type": "@todo" }, + { "name": "size", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "description", "type": "@todo" }, + { "name": "content_type", "type": "@todo" } + ] + } + }, + { + "name": "events", + "singular_name": "event", + "type": "Event", + "get_list": true + }, + { + "name": "forks", + "singular_name": "fork", + "type": "Repository", + "get_list": true + }, + { + "name": "git_blobs", + "singular_name": "git_blob", + "type": "GitBlob", + "get_element": { + "mandatory_parameters": [ + { "name": "sha", "type": "@todo" } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "content", "type": "@todo" }, + { "name": "encoding", "type": "@todo" } + ] + } + }, + { + "name": "git_commits", + "singular_name": "git_commit", + "type": "GitCommit", + "get_element": { + "mandatory_parameters": [ + { "name": "sha", "type": "@todo" } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "message", "type": "@todo" }, + { "name": "tree", "type": "@todo" }, + { "name": "parents", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "author", "type": "@todo" }, + { "name": "committer", "type": "@todo" } + ] + } + }, + { + "name": "git_refs", + "singular_name": "git_ref", + "type": "GitRef", + "get_list": true, + "create_element": { + "mandatory_parameters": [ + { "name": "ref", "type": "@todo" }, + { "name": "sha", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "ref", "type": "@todo" } + ] + } + }, + { + "name": "git_tags", + "singular_name": "git_tag", + "type": "GitTag", + "create_element": { + "mandatory_parameters": [ + { "name": "tag", "type": "@todo" }, + { "name": "message", "type": "@todo" }, + { "name": "object", "type": "@todo" }, + { "name": "type", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "tagger", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "sha", "type": "@todo" } + ] + } + }, + { + "name": "git_trees", + "singular_name": "git_tree", + "type": "GitTree", + "create_element": { + "mandatory_parameters": [ + { "name": "tree", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "base_tree", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "sha", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "recursive", "type": "bool" } + ] + } + }, + { + "name": "hooks", + "singular_name": "hook", + "type": "Hook", + "get_list": true, + "create_element": { + "mandatory_parameters": [ + { "name": "name", "type": "@todo" }, + { "name": "config", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "events", "type": "@todo" }, + { "name": "active", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + } + }, + { + "name": "issues", + "singular_name": "issue", + "type": "Issue", + "get_list": { + "optional_parameters": [ + { "name": "milestone", "type": "@todo" }, + { "name": "state", "type": "@todo" }, + { "name": "assignee", "type": "@todo" }, + { "name": "mentioned", "type": "@todo" }, + { "name": "labels", "type": "@todo" }, + { "name": "sort", "type": "@todo" }, + { "name": "direction", "type": "@todo" }, + { "name": "since", "type": "@todo" } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "title", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "body", "type": "@todo" }, + { "name": "assignee", "type": "@todo" }, + { "name": "milestone", "type": "@todo" }, + { "name": "labels", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "number", "type": "@todo" } + ] + } + }, + { + "name": "issues_events", + "singular_name": "issues_event", + "type": "IssueEvent", + "get_list": true, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + } + }, + { + "name": "keys", + "singular_name": "key", + "type": "RepositoryKey", + "get_list": true, + "create_element": { + "mandatory_parameters": [ + { "name": "title", "type": "@todo" }, + { "name": "key", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "id", "type": "@todo" } + ] + } + }, + { + "name": "labels", + "singular_name": "label", + "type": "Label", + "get_list": true, + "create_element": { + "mandatory_parameters": [ + { "name": "name", "type": "@todo" }, + { "name": "color", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "name", "type": "@todo" } + ] + } + }, + { + "name": "milestones", + "singular_name": "milestone", + "type": "Milestone", + "get_list": { + "optional_parameters": [ + { "name": "state", "type": "@todo" }, + { "name": "sort", "type": "@todo" }, + { "name": "direction", "type": "@todo" } + ] + }, + "create_element": { + "mandatory_parameters": [ + { "name": "title", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "state", "type": "@todo" }, + { "name": "description", "type": "@todo" }, + { "name": "due_on", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "number", "type": "@todo" } + ] + } + }, + { + "name": "pulls", + "singular_name": "pull", + "type": "PullRequest", + "get_list": { + "optional_parameters": [ + { "name": "state", "type": "@todo" } + ] + }, + "get_element": { + "mandatory_parameters": [ + { "name": "number", "type": "@todo" } + ] + } + }, + { + "name": "tags", + "singular_name": "tag", + "type": "Tag", + "get_list": true + }, + { + "name": "teams", + "singular_name": "team", + "type": "Team", + "get_list": true + }, + { + "name": "watchers", + "singular_name": "watcher", + "type": "NamedUser", + "get_list": true + } + ], + "additional_methods": [ + { + "name": [ "get", "network", "events" ], + "type": { "cardinality": "list", "name": "Event" }, + "group": "events" + }, + { + "name": [ "get", "languages" ], + "type": "@todo", + "group": "languages" + }, + { + "name": [ "compare" ], + "type": "@todo", + "group": "Comparison", + "mandatory_parameters": [ + { "name": "base", "type": "@todo" }, + { "name": "head", "type": "@todo" } + ] + } + ] + }, + { + "name": "RepositoryKey", + "edit": { + "mandatory_parameters": [ + { "name": "title", "type": "@todo" }, + { "name": "key", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "id", "type": "@todo" }, + { "name": "key", "type": "@todo" }, + { "name": "title", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + }, + { + "name": "Tag", + "attributes": [ + { "name": "name", "type": "@todo" }, + { "name": "tarball_url", "type": "@todo" }, + { "name": "zipball_url", "type": "@todo" }, + { "name": "commit", "type": "Commit" } + ], + "collections": [ + ] + }, + { + "name": "Team", + "edit": { + "mandatory_parameters": [ + { "name": "name", "type": "@todo" } + ], + "optional_parameters": [ + { "name": "permission", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "id", "type": "@todo" }, + { "name": "members_count", "type": "@todo" }, + { "name": "name", "type": "@todo" }, + { "name": "permission", "type": "@todo" }, + { "name": "repos_count", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + { + "name": "members", + "singular_name": "member", + "type": "NamedUser", + "get_list": true, + "add_element": true, + "has_element": true, + "remove_element": true + }, + { + "name": "repos", + "singular_name": "repo", + "type": "Repository", + "get_list": true, + "add_element": true, + "has_element": true, + "remove_element": true + } + ] + }, + { + "name": "UserKey", + "edit": { + "optional_parameters": [ + { "name": "title", "type": "@todo" }, + { "name": "key", "type": "@todo" } + ] + }, + "delete": true, + "attributes": [ + { "name": "id", "type": "@todo" }, + { "name": "key", "type": "@todo" }, + { "name": "title", "type": "@todo" }, + { "name": "url", "type": "@todo" } + ], + "collections": [ + ] + } + ] +} diff --git a/JsonDescriptionOfGithubApiV3/description.001.normalized.json b/JsonDescriptionOfGithubApiV3/description.001.normalized.json new file mode 100644 index 00000000..62ac175d --- /dev/null +++ b/JsonDescriptionOfGithubApiV3/description.001.normalized.json @@ -0,0 +1,7822 @@ +{ + "classes": [ + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "avatar_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "bio" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "blog" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "collaborators" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "company" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "disk_usage" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "email" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "followers" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "following" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "gravatar_id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "hireable" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "location" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "login" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "owned_private_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "plan" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "private_gists" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public_gists" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "total_private_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "type" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "AuthenticatedUser", + "methods": [ + { + "mandatory_parameters": [], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "email" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "blog" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "company" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "location" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "hireable" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "bio" + } + ] + }, + { + "mandatory_parameters": [], + "group": "authorizations", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Authorization" + }, + "name": [ + "create", + "authorization" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "scopes" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "note" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "note_url" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "authorizations", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Authorization" + }, + "name": [ + "get", + "authorization" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "authorizations", + "name": [ + "get", + "authorizations" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/authorizations" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Authorization" + } + }, + { + "mandatory_parameters": [], + "group": "events", + "name": [ + "get", + "events" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/events" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + } + }, + { + "mandatory_parameters": [], + "group": "issues", + "name": [ + "get", + "issues" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/issues" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Issue" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "key" + } + ], + "group": "keys", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "UserKey" + }, + "name": [ + "create", + "key" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "keys", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "UserKey" + }, + "name": [ + "get", + "key" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "keys", + "name": [ + "get", + "keys" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/keys" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "UserKey" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + } + ], + "group": "repos", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": [ + "create", + "repo" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "homepage" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "private" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "has_issues" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "has_wiki" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "has_downloads" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "int" + }, + "name": "team_id" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + } + ], + "group": "repos", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": [ + "get", + "repo" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "repos", + "name": [ + "get", + "repos" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/repos" + } + ], + "verb": "GET" + }, + "optional_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "enum" + }, + "name": "type" + } + ], + "type": { + "simple": false, + "cardinality": "list", + "name": "Repository" + } + }, + { + "mandatory_parameters": [], + "group": "emails", + "name": [ + "add", + "to", + "emails" + ], + "variadic_parameter": { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "email" + }, + "optional_parameters": [], + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + } + }, + { + "mandatory_parameters": [], + "group": "emails", + "name": [ + "get", + "emails" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/emails" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": true, + "cardinality": "list", + "name": "string" + } + }, + { + "mandatory_parameters": [], + "group": "emails", + "name": [ + "remove", + "from", + "emails" + ], + "variadic_parameter": { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "email" + }, + "optional_parameters": [], + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "watched" + } + ], + "group": "watched", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "add", + "to", + "watched" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "watched", + "name": [ + "get", + "watched" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/watched" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Repository" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "watched" + } + ], + "group": "watched", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "has", + "in", + "watched" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "watched" + } + ], + "group": "watched", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "remove", + "from", + "watched" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "following" + } + ], + "group": "following", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "add", + "to", + "following" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "following", + "name": [ + "get", + "following" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/following" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "following" + } + ], + "group": "following", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "has", + "in", + "following" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "following" + } + ], + "group": "following", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "remove", + "from", + "following" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "followers", + "name": [ + "get", + "followers" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/followers" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [], + "group": "orgs", + "name": [ + "get", + "orgs" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/orgs" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Organization" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "public" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "dict" + }, + "name": "files" + } + ], + "group": "gists", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Gist" + }, + "name": [ + "create", + "gist" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "description" + } + ] + }, + { + "mandatory_parameters": [], + "group": "gists", + "name": [ + "get", + "gists" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/gists" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Gist" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "repo" + } + ], + "group": "forking", + "name": [ + "create", + "fork" + ], + "request": { + "url": [ + { + "type": "constant", + "value": "/repos/" + }, + { + "type": "argument", + "value": [ + "repo", + "owner", + "login" + ] + }, + { + "type": "constant", + "value": "/" + }, + { + "type": "argument", + "value": [ + "repo", + "name" + ] + }, + { + "type": "constant", + "value": "/forks" + } + ], + "verb": "POST" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "org" + } + ], + "group": "events", + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + }, + "name": [ + "get", + "organization", + "events" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "gists", + "type": { + "simple": false, + "cardinality": "list", + "name": "Gist" + }, + "name": [ + "get", + "starred", + "gists" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "app" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "note" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "note_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "scopes" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "token" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "Authorization", + "methods": [ + { + "mandatory_parameters": [], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "scopes" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "add_scopes" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "remove_scopes" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "note" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "note_url" + } + ] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Commit" + }, + "name": "commit" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + } + ], + "name": "Branch", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "author" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitCommit" + }, + "name": "commit" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "committer" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "dict" + }, + "name": "files" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "list" + }, + "name": "parents" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "sha" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "dict" + }, + "name": "stats" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "url" + } + ], + "name": "Commit", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + } + ], + "group": "comments", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "CommitComment" + }, + "name": [ + "create", + "comment" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "commit_id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "line" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "path" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "position" + } + ] + }, + { + "mandatory_parameters": [], + "group": "comments", + "name": [ + "get", + "comments" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "CommitComment" + } + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "commit_id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "line" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "path" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "position" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "user" + } + ], + "name": "CommitComment", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "accesskeyid" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "acl" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "bucket" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "content_type" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "download_count" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "expirationdate" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "mime_type" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "path" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "policy" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "prefix" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "redirect" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "s3_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "signature" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "size" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "Download", + "methods": [ + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "actor" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "commit_id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "event" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "issue" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Organization" + }, + "name": "org" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "payload" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "repo" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "type" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "Event", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "comments" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "files" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "forks" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "git_pull_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "git_push_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "history" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "integer" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "user" + } + ], + "name": "Gist", + "methods": [ + { + "mandatory_parameters": [], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "files" + } + ] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + } + ], + "group": "comments", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GistComment" + }, + "name": [ + "create", + "comment" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "comments", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GistComment" + }, + "name": [ + "get", + "comment" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "comments", + "name": [ + "get", + "comments" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "GistComment" + } + }, + { + "mandatory_parameters": [], + "group": "starring", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "is", + "starred" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "starring", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "reset", + "starred" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "starring", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "set", + "starred" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "forking", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Gist" + }, + "name": [ + "create", + "fork" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "user" + } + ], + "name": "GistComment", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "content" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "encoding" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "size" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "GitBlob", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "author" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "committer" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "message" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "parents" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitTree" + }, + "name": "tree" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "GitCommit", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "object" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "ref" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "GitRef", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "force" + } + ] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "message" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "object" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "tag" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "tagger" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "GitTag", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "recursive" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "tree" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "GitTree", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "active" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "config" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "events" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "last_response" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "Hook", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "config" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "events" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "add_events" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "remove_events" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "active" + } + ] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "testing", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "test" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "assignee" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "closed_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "closed_by" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "comments" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "labels" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Milestone" + }, + "name": "milestone" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "number" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "pull_request" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "user" + } + ], + "name": "Issue", + "methods": [ + { + "mandatory_parameters": [], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "assignee" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "milestone" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "labels" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "body" + } + ], + "group": "comments", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "IssueComment" + }, + "name": [ + "create", + "comment" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "comments", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "IssueComment" + }, + "name": [ + "get", + "comment" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "comments", + "name": [ + "get", + "comments" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "IssueComment" + } + }, + { + "mandatory_parameters": [], + "group": "events", + "name": [ + "get", + "events" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/events" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "IssueEvent" + } + }, + { + "mandatory_parameters": [], + "group": "labels", + "name": [ + "add", + "to", + "labels" + ], + "variadic_parameter": { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Label" + }, + "name": "label" + }, + "optional_parameters": [], + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + } + }, + { + "mandatory_parameters": [], + "group": "labels", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete", + "labels" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "labels", + "name": [ + "get", + "labels" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/labels" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Label" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Label" + }, + "name": "label" + } + ], + "group": "labels", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "remove", + "from", + "labels" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "labels", + "name": [ + "set", + "labels" + ], + "variadic_parameter": { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Label" + }, + "name": "label" + }, + "optional_parameters": [], + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + } + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "user" + } + ], + "name": "IssueComment", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "actor" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "commit_id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "event" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "issue" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "IssueEvent", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "color" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "Label", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "color" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "closed_issues" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "creator" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "due_on" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "number" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "open_issues" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "Milestone", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "due_on" + } + ] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "labels", + "name": [ + "get", + "labels" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/labels" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Label" + } + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "avatar_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "bio" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "blog" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "collaborators" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "company" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "contributions" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "disk_usage" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "email" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "integer" + }, + "name": "followers" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "following" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "gravatar_id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "hireable" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "location" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "login" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "owned_private_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "plan" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "private_gists" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public_gists" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "total_private_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "type" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "NamedUser", + "methods": [ + { + "mandatory_parameters": [], + "group": "events", + "name": [ + "get", + "events" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/events" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + } + }, + { + "mandatory_parameters": [], + "group": "followers", + "name": [ + "get", + "followers" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/followers" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [], + "group": "following", + "name": [ + "get", + "following" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/following" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + } + ], + "group": "repos", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": [ + "get", + "repo" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "repos", + "name": [ + "get", + "repos" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/repos" + } + ], + "verb": "GET" + }, + "optional_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "enum" + }, + "name": "type" + } + ], + "type": { + "simple": false, + "cardinality": "list", + "name": "Repository" + } + }, + { + "mandatory_parameters": [], + "group": "watched", + "name": [ + "get", + "watched" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/watched" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Repository" + } + }, + { + "mandatory_parameters": [], + "group": "orgs", + "name": [ + "get", + "orgs" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/orgs" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Organization" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "public" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "dict" + }, + "name": "files" + } + ], + "group": "gists", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Gist" + }, + "name": [ + "create", + "gist" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "description" + } + ] + }, + { + "mandatory_parameters": [], + "group": "gists", + "name": [ + "get", + "gists" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/gists" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Gist" + } + }, + { + "mandatory_parameters": [], + "group": "events", + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + }, + "name": [ + "get", + "public", + "events" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "events", + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + }, + "name": [ + "get", + "received", + "events" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "events", + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + }, + "name": [ + "get", + "public", + "received", + "events" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "avatar_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "billing_email" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "blog" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "collaborators" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "company" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "disk_usage" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "email" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "followers" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "following" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "gravatar_id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "location" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "login" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "owned_private_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "plan" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "private_gists" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public_gists" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "total_private_repos" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "type" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "Organization", + "methods": [ + { + "mandatory_parameters": [], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "billing_email" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "blog" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "company" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "email" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "location" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + } + ] + }, + { + "mandatory_parameters": [], + "group": "events", + "name": [ + "get", + "events" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/events" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + } + }, + { + "mandatory_parameters": [], + "group": "members", + "name": [ + "get", + "members" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/members" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "member" + } + ], + "group": "members", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "has", + "in", + "members" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "member" + } + ], + "group": "members", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "remove", + "from", + "members" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "public_member" + } + ], + "group": "public_members", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "add", + "to", + "public_members" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "public_members", + "name": [ + "get", + "public_members" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/public_members" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "public_member" + } + ], + "group": "public_members", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "has", + "in", + "public_members" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "public_member" + } + ], + "group": "public_members", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "remove", + "from", + "public_members" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + } + ], + "group": "repos", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": [ + "create", + "repo" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "homepage" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "private" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "has_issues" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "has_wiki" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "has_downloads" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "int" + }, + "name": "team_id" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + } + ], + "group": "repos", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": [ + "get", + "repo" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "repos", + "name": [ + "get", + "repos" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/repos" + } + ], + "verb": "GET" + }, + "optional_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "enum" + }, + "name": "type" + } + ], + "type": { + "simple": false, + "cardinality": "list", + "name": "Repository" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + } + ], + "group": "teams", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Team" + }, + "name": [ + "create", + "team" + ], + "optional_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "list" + }, + "name": "repo_names" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "enum" + }, + "name": "permission" + } + ] + }, + { + "mandatory_parameters": [], + "group": "teams", + "name": [ + "get", + "teams" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/teams" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Team" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "repo" + } + ], + "group": "forking", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": [ + "create", + "fork" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "additions" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "base" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "changed_files" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "closed_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "comments" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "commits" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "deletions" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "diff_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "head" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "issue_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "mergeable" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "merged" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "merged_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "merged_by" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "number" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "patch_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "review_comments" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "user" + } + ], + "name": "PullRequest", + "methods": [ + { + "mandatory_parameters": [], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "comments", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "PullRequestComment" + }, + "name": [ + "get", + "comment" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "comments", + "name": [ + "get", + "comments" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "PullRequestComment" + } + }, + { + "mandatory_parameters": [], + "group": "commits", + "name": [ + "get", + "commits" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/commits" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Commit" + } + }, + { + "mandatory_parameters": [], + "group": "files", + "name": [ + "get", + "files" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/files" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "PullRequestFile" + } + }, + { + "mandatory_parameters": [], + "group": "merging", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "is", + "merged" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "merging", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "merge" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "commit_message" + } + ] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "commit_id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "line" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "path" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "position" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "user" + } + ], + "name": "PullRequestComment", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "additions" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "blob_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "changes" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "deletions" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "filename" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "patch" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "raw_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "status" + } + ], + "name": "PullRequestFile", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "clone_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "created_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "fork" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "forks" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "git_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "has_downloads" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "has_issues" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "has_wiki" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "homepage" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "html_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "language" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "master_branch" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "mirror_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "string" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "open_issues" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "organization" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "owner" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "parent" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "permissions" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "private" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "pushed_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "size" + }, + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "source" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "ssh_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "svn_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "updated_at" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "watchers" + } + ], + "name": "Repository", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "homepage" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "public" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "has_issues" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "has_wiki" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "has_downloads" + } + ] + }, + { + "mandatory_parameters": [], + "group": "branches", + "name": [ + "get", + "branches" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/branches" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Branch" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "collaborator" + } + ], + "group": "collaborators", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "add", + "to", + "collaborators" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "collaborators", + "name": [ + "get", + "collaborators" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/collaborators" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "collaborator" + } + ], + "group": "collaborators", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "has", + "in", + "collaborators" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "collaborator" + } + ], + "group": "collaborators", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "remove", + "from", + "collaborators" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "comments", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "CommitComment" + }, + "name": [ + "get", + "comment" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "comments", + "name": [ + "get", + "comments" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/comments" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "CommitComment" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + } + ], + "group": "commits", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Commit" + }, + "name": [ + "get", + "commit" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "commits", + "name": [ + "get", + "commits" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/commits" + } + ], + "verb": "GET" + }, + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "path" + } + ], + "type": { + "simple": false, + "cardinality": "list", + "name": "Commit" + } + }, + { + "mandatory_parameters": [], + "group": "contributors", + "name": [ + "get", + "contributors" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/contributors" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "size" + } + ], + "group": "downloads", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Download" + }, + "name": [ + "create", + "download" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "content_type" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "downloads", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Download" + }, + "name": [ + "get", + "download" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "downloads", + "name": [ + "get", + "downloads" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/downloads" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Download" + } + }, + { + "mandatory_parameters": [], + "group": "events", + "name": [ + "get", + "events" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/events" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + } + }, + { + "mandatory_parameters": [], + "group": "forks", + "name": [ + "get", + "forks" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/forks" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Repository" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "content" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "encoding" + } + ], + "group": "git_blobs", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitBlob" + }, + "name": [ + "create", + "git_blob" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + } + ], + "group": "git_blobs", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitBlob" + }, + "name": [ + "get", + "git_blob" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "message" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "tree" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "parents" + } + ], + "group": "git_commits", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitCommit" + }, + "name": [ + "create", + "git_commit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "author" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "committer" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + } + ], + "group": "git_commits", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitCommit" + }, + "name": [ + "get", + "git_commit" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "ref" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + } + ], + "group": "git_refs", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitRef" + }, + "name": [ + "create", + "git_ref" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "ref" + } + ], + "group": "git_refs", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitRef" + }, + "name": [ + "get", + "git_ref" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "git_refs", + "name": [ + "get", + "git_refs" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/git_refs" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "GitRef" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "tag" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "message" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "object" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "type" + } + ], + "group": "git_tags", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitTag" + }, + "name": [ + "create", + "git_tag" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "tagger" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + } + ], + "group": "git_tags", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitTag" + }, + "name": [ + "get", + "git_tag" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "tree" + } + ], + "group": "git_trees", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitTree" + }, + "name": [ + "create", + "git_tree" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "base_tree" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sha" + } + ], + "group": "git_trees", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "GitTree" + }, + "name": [ + "get", + "git_tree" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": "recursive" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "config" + } + ], + "group": "hooks", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Hook" + }, + "name": [ + "create", + "hook" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "events" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "active" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "hooks", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Hook" + }, + "name": [ + "get", + "hook" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "hooks", + "name": [ + "get", + "hooks" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/hooks" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Hook" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + } + ], + "group": "issues", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Issue" + }, + "name": [ + "create", + "issue" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "body" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "assignee" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "milestone" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "labels" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "number" + } + ], + "group": "issues", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Issue" + }, + "name": [ + "get", + "issue" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "issues", + "name": [ + "get", + "issues" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/issues" + } + ], + "verb": "GET" + }, + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "milestone" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "assignee" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "mentioned" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "labels" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sort" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "direction" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "since" + } + ], + "type": { + "simple": false, + "cardinality": "list", + "name": "Issue" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "issues_events", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "IssueEvent" + }, + "name": [ + "get", + "issues_event" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "issues_events", + "name": [ + "get", + "issues_events" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/issues_events" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "IssueEvent" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "key" + } + ], + "group": "keys", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "RepositoryKey" + }, + "name": [ + "create", + "key" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + } + ], + "group": "keys", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "RepositoryKey" + }, + "name": [ + "get", + "key" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "keys", + "name": [ + "get", + "keys" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/keys" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "RepositoryKey" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "color" + } + ], + "group": "labels", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Label" + }, + "name": [ + "create", + "label" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + } + ], + "group": "labels", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Label" + }, + "name": [ + "get", + "label" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "labels", + "name": [ + "get", + "labels" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/labels" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Label" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + } + ], + "group": "milestones", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Milestone" + }, + "name": [ + "create", + "milestone" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "description" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "due_on" + } + ] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "number" + } + ], + "group": "milestones", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Milestone" + }, + "name": [ + "get", + "milestone" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "milestones", + "name": [ + "get", + "milestones" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/milestones" + } + ], + "verb": "GET" + }, + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "sort" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "direction" + } + ], + "type": { + "simple": false, + "cardinality": "list", + "name": "Milestone" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "number" + } + ], + "group": "pulls", + "type": { + "simple": false, + "cardinality": "scalar", + "name": "PullRequest" + }, + "name": [ + "get", + "pull" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "pulls", + "name": [ + "get", + "pulls" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/pulls" + } + ], + "verb": "GET" + }, + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "state" + } + ], + "type": { + "simple": false, + "cardinality": "list", + "name": "PullRequest" + } + }, + { + "mandatory_parameters": [], + "group": "tags", + "name": [ + "get", + "tags" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/tags" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Tag" + } + }, + { + "mandatory_parameters": [], + "group": "teams", + "name": [ + "get", + "teams" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/teams" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Team" + } + }, + { + "mandatory_parameters": [], + "group": "watchers", + "name": [ + "get", + "watchers" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/watchers" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [], + "group": "events", + "type": { + "simple": false, + "cardinality": "list", + "name": "Event" + }, + "name": [ + "get", + "network", + "events" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "languages", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": [ + "get", + "languages" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "base" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "head" + } + ], + "group": "Comparison", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": [ + "compare" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "key" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "RepositoryKey", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "key" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Commit" + }, + "name": "commit" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "tarball_url" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "zipball_url" + } + ], + "name": "Tag", + "methods": [] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "members_count" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "permission" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "repos_count" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "Team", + "methods": [ + { + "mandatory_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "name" + } + ], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "permission" + } + ] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "member" + } + ], + "group": "members", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "add", + "to", + "members" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "members", + "name": [ + "get", + "members" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/members" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "NamedUser" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "member" + } + ], + "group": "members", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "has", + "in", + "members" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "NamedUser" + }, + "name": "member" + } + ], + "group": "members", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "remove", + "from", + "members" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "repo" + } + ], + "group": "repos", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "add", + "to", + "repos" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [], + "group": "repos", + "name": [ + "get", + "repos" + ], + "request": { + "url": [ + { + "type": "attribute", + "value": [ + "url" + ] + }, + { + "type": "constant", + "value": "/repos" + } + ], + "verb": "GET" + }, + "optional_parameters": [], + "type": { + "simple": false, + "cardinality": "list", + "name": "Repository" + } + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "repo" + } + ], + "group": "repos", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "bool" + }, + "name": [ + "has", + "in", + "repos" + ], + "optional_parameters": [] + }, + { + "mandatory_parameters": [ + { + "type": { + "simple": false, + "cardinality": "scalar", + "name": "Repository" + }, + "name": "repo" + } + ], + "group": "repos", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "remove", + "from", + "repos" + ], + "optional_parameters": [] + } + ] + }, + { + "attributes": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "id" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "key" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "url" + } + ], + "name": "UserKey", + "methods": [ + { + "mandatory_parameters": [], + "group": "modification", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "edit" + ], + "optional_parameters": [ + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "title" + }, + { + "type": { + "simple": true, + "cardinality": "scalar", + "name": "@todo" + }, + "name": "key" + } + ] + }, + { + "mandatory_parameters": [], + "group": "deletion", + "type": { + "simple": true, + "cardinality": "scalar", + "name": "void" + }, + "name": [ + "delete" + ], + "optional_parameters": [] + } + ] + } + ] +} \ No newline at end of file diff --git a/JsonDescriptionOfGithubApiV3/normalize.py b/JsonDescriptionOfGithubApiV3/normalize.py new file mode 100644 index 00000000..ece3bcd4 --- /dev/null +++ b/JsonDescriptionOfGithubApiV3/normalize.py @@ -0,0 +1,372 @@ +#!/bin/env python + +import os.path +import json +import itertools + +class Type: + def __init__( self, arg ): + if isinstance( arg, ( str, unicode ) ): + self.__fromString( arg ) + else: + self.__fromDesc( arg ) + + def ToJson( self ): + return { + "cardinality": self.cardinality, + "name": self.name, + "simple": self.name in [ "void", "string", "integer", "bool", "float", "@todo" ], + } + + def __fromString( self, name ): + self.cardinality = "scalar" + self.name = name + + def __fromDesc( self, desc ): + self.cardinality = desc[ "cardinality" ] + self.name = desc[ "name" ] + +class Variable: + def __init__( self, desc ): + self.name = desc[ "name" ] + self.type = Type( desc[ "type" ] ) + + def ToJson( self ): + return { + "name": self.name, + "type": self.type, + } + +class Function: + # method + # input + # self + # arguments + # output + # type + # bool + # object + # fundamental type + # list of + # object + # fundamental type + # body + # status or data request + # url from input + # GET parameters from input + # POST parameters from input + + def __init__( self, desc, *additional_descs ): + for additional_desc in additional_descs: + desc.update( additional_desc ) + self.name = desc[ "name" ] + self.type = Type( desc[ "type" ] ) + self.group = desc[ "group" ] + self.mandatory_parameters = list() + if "mandatory_parameters" in desc: + for parameter in desc[ "mandatory_parameters" ]: + self.mandatory_parameters.append( Variable( parameter ) ) + self.optional_parameters = list() + if "optional_parameters" in desc: + for parameter in desc[ "optional_parameters" ]: + self.optional_parameters.append( Variable( parameter ) ) + if "variadic_parameter" in desc: + self.variadic_parameter = Variable( desc[ "variadic_parameter" ] ) + else: + self.variadic_parameter = None + if "request" in desc: + self.request = desc[ "request" ] + else: + self.request = None + + def ToJson( self ): + json = { + "name": self.name, + "type": self.type, + "group": self.group, + "mandatory_parameters": self.mandatory_parameters, + "optional_parameters": self.optional_parameters, + } + if self.variadic_parameter is not None: + json[ "variadic_parameter" ] = self.variadic_parameter + if self.request is not None: + json[ "request" ] = self.request + return json + +class Collection: + def __init__( self, desc ): + name = desc[ "name" ] if isinstance( desc[ "name" ], list ) else [ desc[ "name" ] ] + self.methods = list() + if "add_element" in desc: + assert desc[ "add_element" ] is True + self.methods.append( Function( { "name": [ "add", "to" ] + name, "type": "void", "group": desc[ "name" ], "mandatory_parameters": [ { "name": desc[ "singular_name" ], "type": desc[ "type" ] } ] } ) ) + if "add_several_elements" in desc: + assert desc[ "add_several_elements" ] is True + self.methods.append( Function( { "name": [ "add", "to" ] + name, "type": "void", "group": desc[ "name" ], "variadic_parameter": { "name": desc[ "singular_name" ], "type": desc[ "type" ] } } ) ) + if "create_element" in desc: + self.methods.append( Function( desc[ "create_element" ], { "name": [ "create", desc[ "singular_name" ] ], "type": desc[ "type" ], "group": desc[ "name" ] } ) ) + if "delete_list" in desc: + assert desc[ "delete_list" ] is True + self.methods.append( Function( { "name": [ "delete" ] + name, "type": "void", "group": desc[ "name" ] } ) ) + if "get_element" in desc: + self.methods.append( Function( desc[ "get_element" ], { "name": [ "get", desc[ "singular_name" ] ], "type": desc[ "type" ], "group": desc[ "name" ] } ) ) + if "get_list" in desc: + self.methods.append( Function( + desc[ "get_list" ] if desc[ "get_list" ] is not True else dict(), + { "name": [ "get" ] + name, "type": { "cardinality": "list", "name": desc[ "type" ] }, "group": desc[ "name" ] }, + { "request": { + "verb": "GET", + "url": [ { "type": "attribute", "value": [ "url" ] }, { "type": "constant", "value": "/" + desc[ "name" ] } ], + } + } + ) ) + if "has_element" in desc: + assert desc[ "has_element" ] is True + self.methods.append( Function( { "name": [ "has", "in" ] + name, "type": "bool", "group": desc[ "name" ], "mandatory_parameters": [ { "name": desc[ "singular_name" ], "type": desc[ "type" ] } ] } ) ) + if "remove_element" in desc: + assert desc[ "remove_element" ] is True + self.methods.append( Function( { "name": [ "remove", "from" ] + name, "type": "void", "group": desc[ "name" ], "mandatory_parameters": [ { "name": desc[ "singular_name" ], "type": desc[ "type" ] } ] } ) ) + if "remove_several_elements" in desc: + assert desc[ "remove_several_elements" ] is True + self.methods.append( Function( { "name": [ "remove", "from" ] + name, "type": "void", "group": desc[ "name" ], "variadic_parameter": { "name": desc[ "singular_name" ], "type": desc[ "type" ] } } ) ) + if "set_list" in desc: + assert desc[ "set_list" ] is True + self.methods.append( Function( { "name": [ "set" ] + name, "type": "void", "group": desc[ "name" ], "variadic_parameter": { "name": desc[ "singular_name" ], "type": desc[ "type" ] } } ) ) + +class Class: + def __init__( self, desc ): + self.name = desc[ "name" ] + self.attributes = sorted( + [ + Variable( attr ) + for attr in desc[ "attributes" ] + ], + key = lambda class_: class_.name + ) + self.methods = [] + if "edit" in desc: + self.methods.append( Function( desc[ "edit" ], { "name": [ "edit" ], "type": "void", "group": "modification" } ) ) + if "delete" in desc: + self.methods.append( Function( { "name": [ "delete" ], "type": "void", "group": "deletion" } ) ) + for collection in [ Collection( collection ) for collection in desc[ "collections" ] ]: + self.methods += collection.methods + if "additional_methods" in desc: + self.methods += [ Function( method ) for method in desc[ "additional_methods" ] ] + + def ToJson( self ): + return { + "name": self.name, + "attributes": self.attributes, + "methods": self.methods, + } + +class Description: + def __init__( self, desc ): + self.classes = sorted( + [ + Class( class_ ) + for class_ in desc[ "classes" ] + ], + key = lambda class_: class_.name + ) + + def ToJson( self ): + return { + "classes": self.classes, + } + + def save( self, fileName ): + class Encoder( json.JSONEncoder ): + def default( self, obj ): + if hasattr( obj, "ToJson" ): + return obj.ToJson() + return json.JSONEncoder.default( self, obj ) + + with open( os.path.join( os.path.dirname( __file__ ), fileName ), "w" ) as f: + json.dump( self, f, indent = 4, cls = Encoder ) + +with open( os.path.join( os.path.dirname( __file__ ), "description.000.human_readable.json" ) ) as f: + description = Description( json.load( f ) ) + +description.save( "description.001.normalized.json" ) + +# def normalizeTypes( description ): + # for class_ in description[ "classes" ]: + # for subObject in itertools.chain( class_[ "collections" ], class_[ "attributes" ] ): + # subObject[ "type" ] = normalizeType( subObject[ "type" ] ) + # if "additional_methods" in class_: + # for subObject in class_[ "additional_methods" ]: + # subObject[ "type" ] = normalizeType( subObject[ "type" ] ) + +# def normalizeType( type ): + # def isSimple( typeName ): + # return typeName in [ "string", "integer", "bool", "float", "@todo" ] + # if isinstance( type, ( str, unicode ) ): + # return { + # "cardinality": "scalar", + # "simple": isSimple( type ), + # "name": type, + # } + # else: + # type[ "simple" ] = isSimple( type[ "name" ] ) + # return type + +# def normalizeFunction( function ): + # if "mandatory_parameters" not in function: + # function[ "mandatory_parameters" ] = [] + # if "optional_parameters" not in function: + # function[ "optional_parameters" ] = [] + # if "automatic_parameters" not in function: + # function[ "automatic_parameters" ] = [] + +# def normalizeFunctions( description ): + # for class_ in description[ "classes" ]: + # if "edit" in class_: + # normalizeFunction( class_[ "edit" ] ) + # if "delete" in class_: + # if class_[ "delete" ] is True: + # class_[ "delete" ] = {} + # normalizeFunction( class_[ "delete" ] ) + # for collection in class_[ "collections" ]: + # def completeImplicitFunction( name, explicitDefinition ): + # if name in collection and collection[ name ] is True: + # collection[ name ] = explicitDefinition + + # completeImplicitFunction( "get_list", + # {} + # ) + # completeImplicitFunction( "delete_list", + # {} + # ) + # completeImplicitFunction( "add_element", + # { "mandatory_parameters": [ { "name": collection[ "singular_name" ], "type": collection[ "type" ][ "name" ] } ] } + # ) + # completeImplicitFunction( "remove_element", + # { "mandatory_parameters": [ { "name": collection[ "singular_name" ], "type": collection[ "type" ][ "name" ] } ] } + # ) + # completeImplicitFunction( "has_element", + # { "mandatory_parameters": [ { "name": collection[ "singular_name" ], "type": collection[ "type" ][ "name" ] } ] } + # ) + + # for function in [ "get_list", "delete_list", "has_element", "get_element", "add_element", "remove_element", "create_element" ]: + # if function in collection: + # normalizeFunction( collection[ function ] ) + +# def normalizeAttributes( description ): + # for class_ in description[ "classes" ]: + # for attribute in class_[ "attributes" ]: + # if "mandatory" not in attribute: + # attribute[ "mandatory" ] = False + # if "identifying" not in attribute: + # attribute[ "identifying" ] = False + +# def gatherDependencies( description ): + # for class_ in description[ "classes" ]: + # dependencies = set() + # for subObject in itertools.chain( class_[ "collections" ], class_[ "attributes" ] ): + # if not subObject[ "type" ][ "simple" ]: + # if subObject[ "type" ][ "name" ] != class_[ "name" ]: + # dependencies.add( subObject[ "type" ][ "name" ] ) + # class_[ "dependencies" ] = list( dependencies ) + +# def generateMethodDescriptions( description ): + # for class_ in description[ "classes" ]: + # methods = list() + # if "additional_methods" in class_: + # for method in class_[ "additional_methods" ]: + # methods.append( method ) + # for collection in class_[ "collections" ]: + # if "get_list" in collection: + # method = { + # "name": [ "get", collection[ "name" ] ], + # "group": collection[ "name" ], + # "type": { "cardinality": "list", "base": collection[ "type" ] }, + # "request": { + # "verb": "GET", + # "url": [ + # { "type": "attribute", "value": [ "url" ] }, + # { "type": "constant", "value": "/" + collection[ "name" ] }, + # ], + # }, + # } + # methods.append( method ) + # class_[ "methods" ] = methods + +# def checkDescription( description ): + # def checkKeys( d, mandatory_keys, optional_keys = [] ): + # assert set( d.keys() ) >= set( mandatory_keys ), d + # assert set( d.keys() ) <= set( mandatory_keys ) | set( optional_keys ) | set( [ "@todo" ] ), d + + # def checkString( s ): + # assert isinstance( s, ( str, unicode ) ) + + # def checkBool( s ): + # assert isinstance( s, bool ) + + # def checkConcatenation( concatenation ): + # for part in concatenation: + # checkKeys( part, [ "type", "value" ] ) + # assert part[ "type" ] in [ "constant", "attribute" ] + # if part[ "type" ] == "constant": + # checkString( part[ "value" ] ) + # if part[ "type" ] == "attribute": + # for level in part[ "value" ]: + # checkString( level ) + + # def checkType( type ): + # checkKeys( type, [ "simple", "name" ] ) + # checkBool( type[ "simple" ] ) + # checkString( type[ "name" ] ) + + # def checkParameter( parameter ): + # checkKeys( parameter, [ "name", "type" ], [ "values" ] ) + # checkString( parameter[ "name" ] ) + # checkString( parameter[ "type" ] ) + + # def checkFunction( function ): + # checkKeys( function, [ "mandatory_parameters", "optional_parameters" ], [ "automatic_parameters" ] ) + # for parameter in itertools.chain( function[ "mandatory_parameters" ], function[ "optional_parameters" ] ): + # checkParameter( parameter ) + # if "automatic_parameters" in function: + # for parameter in function[ "automatic_parameters" ]: + # checkKeys( parameter, [ "name", "source" ] ) + # checkString( parameter[ "name" ] ) + # checkConcatenation( parameter[ "source" ] ) + + # checkKeys( description, [ "classes" ] ) + # for class_ in description[ "classes" ]: + # checkKeys( class_, [ "name", "dependencies", "collections", "attributes" ], [ "base_url", "identity", "edit", "delete" ] ) + # checkString( class_[ "name" ] ) + # for dependency in class_[ "dependencies" ]: + # checkString( dependency ) + # for collection in class_[ "collections" ]: + # functions = [ "get_list", "delete_list", "has_element", "get_element", "add_element", "remove_element", "create_element" ] + # checkKeys( collection, [ "name", "singular_name", "type" ], [ "special_url", "add_several_elements", "remove_several_elements", "set_list" ] + functions ) + # checkString( collection[ "name" ] ) + # checkString( collection[ "singular_name" ] ) + # checkType( collection[ "type" ] ) + # if "special_url" in collection: + # checkString( collection[ "special_url" ] ) + # for function in functions: + # if function in collection: + # checkFunction( collection[ function ] ) + # if "add_several_elements" in collection: + # checkBool( collection[ "add_several_elements" ] ) + # if "remove_several_elements" in collection: + # checkBool( collection[ "remove_several_elements" ] ) + # if "set_list" in collection: + # checkBool( collection[ "set_list" ] ) + # for attribute in class_[ "attributes" ]: + # checkKeys( attribute, [ "name", "type", "mandatory", "identifying" ] ) + # checkString( attribute[ "name" ] ) + # checkType( attribute[ "type" ] ) + # checkBool( attribute[ "mandatory" ] ) + # checkBool( attribute[ "identifying" ] ) + # if "base_url" in class_: + # checkConcatenation( class_[ "base_url" ] ) + # if "identity" in class_: + # checkConcatenation( class_[ "identity" ] ) + # if "edit" in class_: + # checkFunction( class_[ "edit" ] ) + # if "delete" in class_: + # checkFunction( class_[ "delete" ] ) diff --git a/ReferenceOfClasses.md b/ReferenceOfClasses.md index af9d0955..a23a0129 100644 --- a/ReferenceOfClasses.md +++ b/ReferenceOfClasses.md @@ -1,6 +1,5 @@ You don't normaly create instances of any class but `Github`. You obtain instances through calls to `get_` and `create_` methods. - Class `Github` ============== * Constructed from user's login and password @@ -15,59 +14,55 @@ Class `AuthenticatedUser` Attributes ---------- -* `login` -* `id` * `avatar_url` -* `gravatar_id` -* `url` -* `name` -* `company` -* `blog` -* `location` -* `email` -* `hireable` * `bio` -* `public_repos` -* `public_gists` +* `blog` +* `collaborators` +* `company` +* `created_at` +* `disk_usage` +* `email` * `followers` * `following` +* `gravatar_id` +* `hireable` * `html_url` -* `created_at` -* `type` -* `total_private_repos` +* `id` +* `location`: string +* `login`: string +* `name`: string * `owned_private_repos` -* `private_gists` -* `disk_usage` -* `collaborators` * `plan` - -Modification ------------- -* `edit( [name, email, blog, company, location, hireable, bio] )` - -Emails ------- -* `get_emails()`: list of string -* `add_to_emails( email, ... )` - * `email`: string -* `remove_from_emails( email, ... )` - * `email`: string +* `private_gists` +* `public_gists` +* `public_repos` +* `total_private_repos` +* `type` +* `url` Authorizations -------------- -* `get_authorizations()`: list of `Authorization` -* `get_authorization( id )`: `Authorization` * `create_authorization( [scopes, note, note_url] )`: `Authorization` + * `scopes` + * `note` + * `note_url` +* `get_authorization( id )`: `Authorization` + * `id` +* `get_authorizations()`: list of `Authorization` -Keys ----- -* `get_keys()`: list of `UserKey` -* `get_key( id )`: `UserKey` -* `create_key( title, key )`: `UserKey` +Emails +------ +* `add_to_emails( email, ... )` + * `email`: string +* `get_emails()`: list of string +* `remove_from_emails( email, ... )` + * `email`: string Events ------ * `get_events()`: list of `Event` +* `get_organization_events( org )`: list of `Event` + * `org` Followers --------- @@ -75,149 +70,193 @@ Followers Following --------- -* `get_following()`: list of `NamedUser` * `add_to_following( following )` * `following`: `NamedUser` +* `get_following()`: list of `NamedUser` +* `has_in_following( following )`: bool + * `following`: `NamedUser` * `remove_from_following( following )` * `following`: `NamedUser` -* `has_in_following( following )`: bool - * `following`: `NamedUser` - -Orgs ----- -* `get_orgs()`: list of `Organization` -* `get_organization_events( org )`: list of `Event` - -Repos ------ -* `get_repos( [type] )`: list of `Repository` -* `get_repo( name )`: `Repository` -* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] )`: `Repository` - -Watched -------- -* `get_watched()`: list of `Repository` -* `add_to_watched( watched )` - * `watched`: `Repository` -* `remove_from_watched( watched )` - * `watched`: `Repository` -* `has_in_watched( watched )`: bool - * `watched`: `Repository` Forking ------- * `create_fork( repo )`: `Repository` + * `repo`: `Repository` Gists ----- -* `get_gists()`: list of `Gist` * `create_gist( public, files, [description] )`: `Gist` + * `public`: bool + * `files`: `dict` + * `description`: string +* `get_gists()`: list of `Gist` * `get_starred_gists()`: list of `Gist` Issues ------ * `get_issues()`: list of `Issue` +Keys +---- +* `create_key( title, key )`: `UserKey` + * `title` + * `key` +* `get_key( id )`: `UserKey` + * `id` +* `get_keys()`: list of `UserKey` + +Modification +------------ +* `edit( [name, email, blog, company, location, hireable, bio] )` + * `name`: string + * `email`: string + * `blog`: string + * `company`: string + * `location`: string + * `hireable`: bool + * `bio`: string + +Orgs +---- +* `get_orgs()`: list of `Organization` + +Repos +----- +* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] )`: `Repository` + * `name`: string + * `description`: string + * `homepage`: string + * `private`: bool + * `has_issues`: bool + * `has_wiki`: bool + * `has_downloads`: bool + * `team_id`: `int` +* `get_repo( name )`: `Repository` + * `name`: string +* `get_repos( [type] )`: list of `Repository` + * `type`: `enum` + +Watched +------- +* `add_to_watched( watched )` + * `watched`: `Repository` +* `get_watched()`: list of `Repository` +* `has_in_watched( watched )`: bool + * `watched`: `Repository` +* `remove_from_watched( watched )` + * `watched`: `Repository` + Class `Authorization` ===================== Attributes ---------- -* `id` -* `url` -* `scopes` -* `token` * `app` +* `created_at` +* `id` * `note` * `note_url` +* `scopes` +* `token` * `updated_at` -* `created_at` - -Modification ------------- -* `edit( [scopes, add_scopes, remove_scopes, note, note_url] )` +* `url` Deletion -------- * `delete()` +Modification +------------ +* `edit( [scopes, add_scopes, remove_scopes, note, note_url] )` + * `scopes` + * `add_scopes` + * `remove_scopes` + * `note` + * `note_url` + Class `Branch` ============== Attributes ---------- -* `name` * `commit`: `Commit` +* `name`: string Class `Commit` ============== Attributes ---------- -* `sha` -* `url` -* `parents` -* `stats` -* `files` -* `commit`: `GitCommit` * `author`: `NamedUser` +* `commit`: `GitCommit` * `committer`: `NamedUser` +* `files`: `dict` +* `parents`: `list` +* `sha`: string +* `stats`: `dict` +* `url`: string Comments -------- -* `get_comments()`: list of `CommitComment` * `create_comment( body, [commit_id, line, path, position] )`: `CommitComment` + * `body` + * `commit_id` + * `line` + * `path` + * `position` +* `get_comments()`: list of `CommitComment` Class `CommitComment` ===================== Attributes ---------- -* `url` -* `id` * `body` -* `path` -* `position` * `commit_id` * `created_at` -* `updated_at` * `html_url` +* `id` * `line` +* `path` +* `position` +* `updated_at` +* `url` * `user`: `NamedUser` -Modification ------------- -* `edit( body )` - Deletion -------- * `delete()` +Modification +------------ +* `edit( body )` + * `body` + Class `Download` ================ Attributes ---------- -* `url` +* `accesskeyid` +* `acl` +* `bucket` +* `content_type` +* `created_at` +* `description` +* `download_count` +* `expirationdate` * `html_url` * `id` -* `name` -* `description` -* `size` -* `download_count` -* `content_type` -* `policy` -* `signature` -* `bucket` -* `accesskeyid` -* `path` -* `acl` -* `expirationdate` -* `prefix` * `mime_type` +* `name` +* `path` +* `policy` +* `prefix` * `redirect` * `s3_url` -* `created_at` +* `signature` +* `size` +* `url` Deletion -------- @@ -228,169 +267,182 @@ Class `Event` Attributes ---------- -* `type` -* `public` -* `payload` -* `created_at` -* `id` -* `commit_id` -* `url` -* `event` -* `issue` -* `repo`: `Repository` * `actor`: `NamedUser` +* `commit_id` +* `created_at` +* `event` +* `id` +* `issue` * `org`: `Organization` +* `payload` +* `public` +* `repo`: `Repository` +* `type` +* `url` Class `Gist` ============ Attributes ---------- -* `url` -* `id` -* `description` -* `public` -* `files` * `comments` -* `html_url` +* `created_at` +* `description`: string +* `files` +* `forks` * `git_pull_url` * `git_push_url` -* `created_at` -* `forks` * `history` +* `html_url` +* `id`: integer +* `public` * `updated_at` +* `url` * `user`: `NamedUser` -Modification ------------- -* `edit( [description, files] )` +Comments +-------- +* `create_comment( body )`: `GistComment` + * `body` +* `get_comment( id )`: `GistComment` + * `id` +* `get_comments()`: list of `GistComment` Deletion -------- * `delete()` -Comments --------- -* `get_comments()`: list of `GistComment` -* `get_comment( id )`: `GistComment` -* `create_comment( body )`: `GistComment` +Forking +------- +* `create_fork()`: `Gist` + +Modification +------------ +* `edit( [description, files] )` + * `description`: string + * `files` Starring -------- * `is_starred()`: bool -* `set_starred()` * `reset_starred()` - -Forking -------- -* `create_fork()`: `Gist` +* `set_starred()` Class `GistComment` =================== Attributes ---------- -* `id` -* `url` * `body` * `created_at` +* `id` * `updated_at` +* `url` * `user`: `NamedUser` -Modification ------------- -* `edit( body )` - Deletion -------- * `delete()` +Modification +------------ +* `edit( body )` + * `body` + Class `GitBlob` =============== Attributes ---------- +* `content` +* `encoding` * `sha` * `size` * `url` -* `content` -* `encoding` Class `GitCommit` ================= Attributes ---------- -* `sha` -* `url` -* `message` -* `parents` * `author` * `committer` +* `message` +* `parents` +* `sha` * `tree`: `GitTree` +* `url` Class `GitRef` ============== Attributes ---------- -* `ref` -* `url` * `object` - -Modification ------------- -* `edit( sha, [force] )` +* `ref`: string +* `url` Deletion -------- * `delete()` +Modification +------------ +* `edit( sha, [force] )` + * `sha` + * `force` + Class `GitTag` ============== Attributes ---------- -* `tag` -* `sha` -* `url` * `message` -* `tagger` * `object` +* `sha` +* `tag` +* `tagger` +* `url` Class `GitTree` =============== Attributes ---------- -* `sha` -* `url` -* `tree` * `recursive` +* `sha` +* `tree` +* `url` Class `Hook` ============ Attributes ---------- -* `url` -* `updated_at` -* `created_at` -* `name` -* `events` * `active` * `config` +* `created_at` +* `events` * `id` * `last_response` - -Modification ------------- -* `edit( name, config, [events, add_events, remove_events, active] )` +* `name` +* `updated_at` +* `url` Deletion -------- * `delete()` +Modification +------------ +* `edit( name, config, [events, add_events, remove_events, active] )` + * `name` + * `config` + * `events` + * `add_events` + * `remove_events` + * `active` + Testing ------- * `test()` @@ -400,118 +452,125 @@ Class `Issue` Attributes ---------- -* `url` +* `assignee`: `NamedUser` +* `body` +* `closed_at` +* `closed_by` +* `comments` +* `created_at` * `html_url` +* `id` +* `labels` +* `milestone`: `Milestone` * `number` +* `pull_request` * `state` * `title` -* `body` -* `labels` -* `comments` -* `closed_at` -* `created_at` * `updated_at` -* `id` -* `closed_by` -* `pull_request` +* `url` * `user`: `NamedUser` -* `assignee`: `NamedUser` -* `milestone`: `Milestone` - -Modification ------------- -* `edit( [title, body, assignee, state, milestone, labels] )` - -Labels ------- -* `get_labels()`: list of `Label` -* `add_to_labels( label, ... )` - * `label`: `Label` -* `set_labels( label, ... )` - * `label`: `Label` -* `delete_labels()` -* `remove_from_labels( label )` - * `label`: `Label` Comments -------- -* `get_comments()`: list of `IssueComment` -* `get_comment( id )`: `IssueComment` * `create_comment( body )`: `IssueComment` + * `body`: string +* `get_comment( id )`: `IssueComment` + * `id` +* `get_comments()`: list of `IssueComment` Events ------ * `get_events()`: list of `IssueEvent` +Labels +------ +* `add_to_labels( label, ... )` + * `label`: `Label` +* `delete_labels()` +* `get_labels()`: list of `Label` +* `remove_from_labels( label )` + * `label`: `Label` +* `set_labels( label, ... )` + * `label`: `Label` + +Modification +------------ +* `edit( [title, body, assignee, state, milestone, labels] )` + * `title` + * `body` + * `assignee` + * `state` + * `milestone` + * `labels` + Class `IssueComment` ==================== Attributes ---------- -* `url` * `body` * `created_at` -* `updated_at` * `id` +* `updated_at` +* `url` * `user`: `NamedUser` -Modification ------------- -* `edit( body )` - Deletion -------- * `delete()` +Modification +------------ +* `edit( body )` + * `body` + Class `IssueEvent` ================== Attributes ---------- -* `id` -* `url` -* `created_at` -* `issue` -* `event` -* `commit_id` * `actor`: `NamedUser` +* `commit_id` +* `created_at` +* `event` +* `id` +* `issue` +* `url` Class `Label` ============= Attributes ---------- -* `url` -* `name` * `color` - -Modification ------------- -* `edit( name, color )` +* `name` +* `url` Deletion -------- * `delete()` +Modification +------------ +* `edit( name, color )` + * `name` + * `color` + Class `Milestone` ================= Attributes ---------- -* `url` -* `number` -* `state` -* `title` -* `description` -* `open_issues` * `closed_issues` * `created_at` -* `due_on` * `creator`: `NamedUser` - -Modification ------------- -* `edit( title, [state, description, due_on] )` +* `description` +* `due_on` +* `number` +* `open_issues` +* `state` +* `title` +* `url` Deletion -------- @@ -521,37 +580,52 @@ Labels ------ * `get_labels()`: list of `Label` +Modification +------------ +* `edit( title, [state, description, due_on] )` + * `title` + * `state` + * `description` + * `due_on` + Class `NamedUser` ================= Attributes ---------- -* `login` -* `id` * `avatar_url` -* `gravatar_id` -* `url` -* `name` -* `company` -* `blog` -* `location` -* `email` -* `hireable` * `bio` -* `public_repos` -* `public_gists` -* `followers` -* `following` -* `html_url` -* `created_at` -* `type` -* `contributions` -* `disk_usage` +* `blog` * `collaborators` -* `plan` -* `total_private_repos` +* `company` +* `contributions` +* `created_at` +* `disk_usage` +* `email` +* `followers`: integer +* `following` +* `gravatar_id` +* `hireable` +* `html_url` +* `id` +* `location`: string +* `login`: string +* `name`: string * `owned_private_repos` +* `plan` * `private_gists` +* `public_gists` +* `public_repos` +* `total_private_repos` +* `type` +* `url` + +Events +------ +* `get_events()`: list of `Event` +* `get_public_events()`: list of `Event` +* `get_received_events()`: list of `Event` +* `get_public_received_events()`: list of `Event` Followers --------- @@ -561,140 +635,158 @@ Following --------- * `get_following()`: list of `NamedUser` +Gists +----- +* `create_gist( public, files, [description] )`: `Gist` + * `public`: bool + * `files`: `dict` + * `description`: string +* `get_gists()`: list of `Gist` + Orgs ---- * `get_orgs()`: list of `Organization` -Events ------- -* `get_events()`: list of `Event` -* `get_public_events()`: list of `Event` - -Received events ---------------- -* `get_received_events()`: list of `Event` -* `get_public_received_events()`: list of `Event` - Repos ----- -* `get_repos( [type] )`: list of `Repository` * `get_repo( name )`: `Repository` + * `name`: string +* `get_repos( [type] )`: list of `Repository` + * `type`: `enum` Watched ------- * `get_watched()`: list of `Repository` -Gists ------ -* `get_gists()`: list of `Gist` -* `create_gist( public, files, [description] )`: `Gist` - Class `Organization` ==================== Attributes ---------- -* `login` -* `id` -* `url` * `avatar_url` -* `name` -* `company` +* `billing_email` * `blog` -* `location` +* `collaborators` +* `company` +* `created_at` +* `disk_usage` * `email` -* `public_repos` -* `public_gists` * `followers` * `following` -* `html_url` -* `created_at` -* `type` * `gravatar_id` -* `disk_usage` -* `collaborators` -* `billing_email` +* `html_url` +* `id` +* `location`: string +* `login`: string +* `name`: string +* `owned_private_repos` * `plan` * `private_gists` +* `public_gists` +* `public_repos` * `total_private_repos` -* `owned_private_repos` - -Modification ------------- -* `edit( [billing_email, blog, company, email, location, name] )` - -Public members --------------- -* `get_public_members()`: list of `NamedUser` -* `add_to_public_members( public_member )` - * `public_member`: `NamedUser` -* `remove_from_public_members( public_member )` - * `public_member`: `NamedUser` -* `has_in_public_members( public_member )`: bool - * `public_member`: `NamedUser` - -Members -------- -* `get_members()`: list of `NamedUser` -* `remove_from_members( member )` - * `member`: `NamedUser` -* `has_in_members( member )`: bool - * `member`: `NamedUser` - -Repos ------ -* `get_repos( [type] )`: list of `Repository` -* `get_repo( name )`: `Repository` -* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] )`: `Repository` - -Forking -------- -* `create_fork( repo )`: `Repository` - -Teams ------ -* `get_teams()`: list of `Team` -* `create_team( name, [repo_names, permission] )`: `Team` +* `type` +* `url` Events ------ * `get_events()`: list of `Event` +Forking +------- +* `create_fork( repo )`: `Repository` + * `repo`: `Repository` + +Members +------- +* `get_members()`: list of `NamedUser` +* `has_in_members( member )`: bool + * `member`: `NamedUser` +* `remove_from_members( member )` + * `member`: `NamedUser` + +Modification +------------ +* `edit( [billing_email, blog, company, email, location, name] )` + * `billing_email` + * `blog` + * `company` + * `email` + * `location` + * `name` + +Public_members +-------------- +* `add_to_public_members( public_member )` + * `public_member`: `NamedUser` +* `get_public_members()`: list of `NamedUser` +* `has_in_public_members( public_member )`: bool + * `public_member`: `NamedUser` +* `remove_from_public_members( public_member )` + * `public_member`: `NamedUser` + +Repos +----- +* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] )`: `Repository` + * `name`: string + * `description`: string + * `homepage`: string + * `private`: bool + * `has_issues`: bool + * `has_wiki`: bool + * `has_downloads`: bool + * `team_id`: `int` +* `get_repo( name )`: `Repository` + * `name`: string +* `get_repos( [type] )`: list of `Repository` + * `type`: `enum` + +Teams +----- +* `create_team( name, [repo_names, permission] )`: `Team` + * `name`: string + * `repo_names`: `list` + * `permission`: `enum` +* `get_teams()`: list of `Team` + Class `PullRequest` =================== Attributes ---------- -* `id` -* `url` -* `html_url` -* `diff_url` -* `patch_url` -* `issue_url` -* `number` -* `state` -* `title` +* `additions` +* `base` * `body` -* `created_at` -* `updated_at` +* `changed_files` * `closed_at` -* `merged_at` -* `merged` -* `mergeable` * `comments` * `commits` -* `additions` +* `created_at` * `deletions` -* `changed_files` +* `diff_url` * `head` -* `base` +* `html_url` +* `id` +* `issue_url` +* `mergeable` +* `merged` +* `merged_at` * `merged_by` +* `number` +* `patch_url` * `review_comments` +* `state` +* `title` +* `updated_at` +* `url` * `user`: `NamedUser` -Modification ------------- -* `edit( [title, body, state] )` +Comments +-------- +* `create_comment( < body, commit_id, path, position > or < body, in_reply_to > )`: `PullRequestComment` +* `get_comment( id )`: `PullRequestComment` + * `id` +* `get_comments()`: list of `PullRequestComment` Commits ------- @@ -704,264 +796,347 @@ Files ----- * `get_files()`: list of `PullRequestFile` -Comments --------- -* `get_comments()`: list of `PullRequestComment` -* `get_comment( id )`: `PullRequestComment` -* `create_comment( < body, commit_id, path, position > or < body, in_reply_to > )`: `PullRequestComment` +Merging +------- * `is_merged()`: bool * `merge( [commit_message] )` + * `commit_message`: string + +Modification +------------ +* `edit( [title, body, state] )` + * `title` + * `body` + * `state` Class `PullRequestComment` ========================== Attributes ---------- -* `url` -* `id` * `body` -* `path` -* `position` * `commit_id` * `created_at` -* `updated_at` * `html_url` +* `id` * `line` +* `path` +* `position` +* `updated_at` +* `url` * `user`: `NamedUser` -Modification ------------- -* `edit( body )` - Deletion -------- * `delete()` +Modification +------------ +* `edit( body )` + * `body` + Class `PullRequestFile` ======================= Attributes ---------- -* `sha` -* `filename` -* `status` * `additions` -* `deletions` -* `changes` * `blob_url` -* `raw_url` +* `changes` +* `deletions` +* `filename` * `patch` +* `raw_url` +* `sha` +* `status` Class `Repository` ================== Attributes ---------- -* `url` -* `html_url` * `clone_url` -* `git_url` -* `ssh_url` -* `svn_url` -* `name` +* `created_at` * `description` -* `homepage` -* `language` -* `private` * `fork` * `forks` -* `watchers` -* `size` -* `master_branch` -* `open_issues` -* `pushed_at` -* `created_at` -* `organization` +* `git_url` +* `has_downloads` * `has_issues` * `has_wiki` -* `has_downloads` -* `mirror_url` -* `updated_at` +* `homepage` +* `html_url` * `id` -* `permissions` +* `language` +* `master_branch` +* `mirror_url` +* `name`: string +* `open_issues` +* `organization` * `owner`: `NamedUser` * `parent`: `Repository` +* `permissions` +* `private` +* `pushed_at` +* `size` * `source`: `Repository` +* `ssh_url` +* `svn_url` +* `updated_at` +* `url` +* `watchers` -Issues events -------------- -* `get_issues_events()`: list of `IssueEvent` -* `get_issues_event( id )`: `IssueEvent` - -Forks ------ -* `get_forks()`: list of `Repository` - -Modification ------------- -* `edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads] )` - -Languages ---------- -* `get_languages()`: dictionary of strings to integers - -Hooks ------ -* `get_hooks()`: list of `Hook` -* `get_hook( id )`: `Hook` -* `create_hook( name, config, [events, active] )`: `Hook` - -Keys ----- -* `get_keys()`: list of `RepositoryKey` -* `get_key( id )`: `RepositoryKey` -* `create_key( title, key )`: `RepositoryKey` - -Collaborators -------------- -* `get_collaborators()`: list of `NamedUser` -* `add_to_collaborators( collaborator )` - * `collaborator`: `NamedUser` -* `remove_from_collaborators( collaborator )` - * `collaborator`: `NamedUser` -* `has_in_collaborators( collaborator )`: bool - * `collaborator`: `NamedUser` - -Contributors ------------- -* `get_contributors()`: list of `NamedUser` - -Watchers --------- -* `get_watchers()`: list of `NamedUser` - -Git refs --------- -* `get_git_refs()`: list of `GitRef` -* `get_git_ref( ref )`: `GitRef` -* `create_git_ref( ref, sha )`: `GitRef` - -Git commits ------------ -* `get_git_commit( sha )`: `GitCommit` -* `create_git_commit( message, tree, parents, [author, committer] )`: `GitCommit` - -Git trees ---------- -* `get_git_tree( sha, [recursive] )`: `GitTree` -* `create_git_tree( tree, [base_tree] )`: `GitTree` - -Git blobs ---------- -* `get_git_blob( sha )`: `GitBlob` -* `create_git_blob( content, encoding )`: `GitBlob` - -Git tags --------- -* `get_git_tag( sha )`: `GitTag` -* `create_git_tag( tag, message, object, type, [tagger] )`: `GitTag` - -Labels ------- -* `get_labels()`: list of `Label` -* `get_label( name )`: `Label` -* `create_label( name, color )`: `Label` - -Milestones +Comparison ---------- -* `get_milestones( [state, sort, direction] )`: list of `Milestone` -* `get_milestone( number )`: `Milestone` -* `create_milestone( title, [state, description, due_on] )`: `Milestone` - -Issues ------- -* `get_issues( [milestone, state, assignee, mentioned, labels, sort, direction, since] )`: list of `Issue` -* `get_issue( number )`: `Issue` -* `create_issue( title, [body, assignee, milestone, labels] )`: `Issue` - -Downloads ---------- -* `get_downloads()`: list of `Download` -* `get_download( id )`: `Download` -* `create_download( name, size, [description, content_type] )`: `Download` - -Comments --------- -* `get_comments()`: list of `CommitComment` -* `get_comment( id )`: `CommitComment` - -Commits -------- -* `get_commits( [sha, path] )`: list of `Commit` -* `get_commit( sha )`: `Commit` - -Tags ----- -* `get_tags()`: list of `Tag` +* `compare( base, head )` + * `base` + * `head` Branches -------- * `get_branches()`: list of `Branch` -Pulls ------ -* `get_pulls( [state] )`: list of `PullRequest` -* `get_pull( number )`: `PullRequest` -* `create_pull( < title, body, base, head > or < issue, base, head > )`: `PullRequest` -* `compare( base, head )` +Collaborators +------------- +* `add_to_collaborators( collaborator )` + * `collaborator`: `NamedUser` +* `get_collaborators()`: list of `NamedUser` +* `has_in_collaborators( collaborator )`: bool + * `collaborator`: `NamedUser` +* `remove_from_collaborators( collaborator )` + * `collaborator`: `NamedUser` -Teams ------ -* `get_teams()`: list of `Team` +Comments +-------- +* `get_comment( id )`: `CommitComment` + * `id` +* `get_comments()`: list of `CommitComment` + +Commits +------- +* `get_commit( sha )`: `Commit` + * `sha` +* `get_commits( [sha, path] )`: list of `Commit` + * `sha` + * `path` + +Contributors +------------ +* `get_contributors()`: list of `NamedUser` + +Downloads +--------- +* `create_download( name, size, [description, content_type] )`: `Download` + * `name` + * `size` + * `description` + * `content_type` +* `get_download( id )`: `Download` + * `id` +* `get_downloads()`: list of `Download` Events ------ * `get_events()`: list of `Event` * `get_network_events()`: list of `Event` +Forks +----- +* `get_forks()`: list of `Repository` + +Git_blobs +--------- +* `create_git_blob( content, encoding )`: `GitBlob` + * `content` + * `encoding` +* `get_git_blob( sha )`: `GitBlob` + * `sha` + +Git_commits +----------- +* `create_git_commit( message, tree, parents, [author, committer] )`: `GitCommit` + * `message` + * `tree` + * `parents` + * `author` + * `committer` +* `get_git_commit( sha )`: `GitCommit` + * `sha` + +Git_refs +-------- +* `create_git_ref( ref, sha )`: `GitRef` + * `ref` + * `sha` +* `get_git_ref( ref )`: `GitRef` + * `ref` +* `get_git_refs()`: list of `GitRef` + +Git_tags +-------- +* `create_git_tag( tag, message, object, type, [tagger] )`: `GitTag` + * `tag` + * `message` + * `object` + * `type` + * `tagger` +* `get_git_tag( sha )`: `GitTag` + * `sha` + +Git_trees +--------- +* `create_git_tree( tree, [base_tree] )`: `GitTree` + * `tree` + * `base_tree` +* `get_git_tree( sha, [recursive] )`: `GitTree` + * `sha` + * `recursive`: bool + +Hooks +----- +* `create_hook( name, config, [events, active] )`: `Hook` + * `name` + * `config` + * `events` + * `active` +* `get_hook( id )`: `Hook` + * `id` +* `get_hooks()`: list of `Hook` + +Issues +------ +* `create_issue( title, [body, assignee, milestone, labels] )`: `Issue` + * `title` + * `body` + * `assignee` + * `milestone` + * `labels` +* `get_issue( number )`: `Issue` + * `number` +* `get_issues( [milestone, state, assignee, mentioned, labels, sort, direction, since] )`: list of `Issue` + * `milestone` + * `state` + * `assignee` + * `mentioned` + * `labels` + * `sort` + * `direction` + * `since` + +Issues_events +------------- +* `get_issues_event( id )`: `IssueEvent` + * `id` +* `get_issues_events()`: list of `IssueEvent` + +Keys +---- +* `create_key( title, key )`: `RepositoryKey` + * `title` + * `key` +* `get_key( id )`: `RepositoryKey` + * `id` +* `get_keys()`: list of `RepositoryKey` + +Labels +------ +* `create_label( name, color )`: `Label` + * `name` + * `color` +* `get_label( name )`: `Label` + * `name` +* `get_labels()`: list of `Label` + +Languages +--------- +* `get_languages()` + +Milestones +---------- +* `create_milestone( title, [state, description, due_on] )`: `Milestone` + * `title` + * `state` + * `description` + * `due_on` +* `get_milestone( number )`: `Milestone` + * `number` +* `get_milestones( [state, sort, direction] )`: list of `Milestone` + * `state` + * `sort` + * `direction` + +Modification +------------ +* `edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads] )` + * `name` + * `description` + * `homepage` + * `public` + * `has_issues` + * `has_wiki` + * `has_downloads` + +Pulls +----- +* `create_pull( < title, body, base, head > or < issue, base, head > )`: `PullRequest` +* `get_pull( number )`: `PullRequest` + * `number` +* `get_pulls( [state] )`: list of `PullRequest` + * `state` + +Tags +---- +* `get_tags()`: list of `Tag` + +Teams +----- +* `get_teams()`: list of `Team` + +Watchers +-------- +* `get_watchers()`: list of `NamedUser` + Class `RepositoryKey` ===================== Attributes ---------- -* `url` * `id` -* `title` * `key` - -Modification ------------- -* `edit( title, key )` +* `title` +* `url` Deletion -------- * `delete()` +Modification +------------ +* `edit( title, key )` + * `title` + * `key` + Class `Tag` =========== Attributes ---------- -* `name` -* `zipball_url` -* `tarball_url` * `commit`: `Commit` +* `name` +* `tarball_url` +* `zipball_url` Class `Team` ============ Attributes ---------- -* `url` -* `name` * `id` -* `permission` * `members_count` +* `name` +* `permission` * `repos_count` - -Modification ------------- -* `edit( name, [permission] )` +* `url` Deletion -------- @@ -969,40 +1144,46 @@ Deletion Members ------- -* `get_members()`: list of `NamedUser` * `add_to_members( member )` * `member`: `NamedUser` +* `get_members()`: list of `NamedUser` +* `has_in_members( member )`: bool + * `member`: `NamedUser` * `remove_from_members( member )` * `member`: `NamedUser` -* `has_in_members( member )`: bool - * `member`: `NamedUser` + +Modification +------------ +* `edit( name, [permission] )` + * `name` + * `permission` Repos ----- -* `get_repos()`: list of `Repository` * `add_to_repos( repo )` * `repo`: `Repository` -* `remove_from_repos( repo )` - * `repo`: `Repository` +* `get_repos()`: list of `Repository` * `has_in_repos( repo )`: bool * `repo`: `Repository` +* `remove_from_repos( repo )` + * `repo`: `Repository` Class `UserKey` =============== Attributes ---------- -* `url` * `id` -* `title` * `key` - -Modification ------------- -* `edit( [title, key] )` +* `title` +* `url` Deletion -------- * `delete()` - +Modification +------------ +* `edit( [title, key] )` + * `title` + * `key` diff --git a/github/GenerateReferenceOfClasses.py b/github/GenerateReferenceOfClasses.py index c7c328b2..12764ab6 100644 --- a/github/GenerateReferenceOfClasses.py +++ b/github/GenerateReferenceOfClasses.py @@ -3,7 +3,7 @@ import GithubObjects def generateDocumentation(): - classes = [ getattr( GithubObjects, c ) for c in dir( GithubObjects ) if hasattr( getattr( GithubObjects, c ), "_autoDocument" ) ] + classes = [ getattr( GithubObjects, c ) for c in sorted( dir( GithubObjects ) ) if hasattr( getattr( GithubObjects, c ), "_autoDocument" ) ] doc = "" for c in classes: doc += c._autoDocument() diff --git a/github/Github.py b/github/Github.py index e6373d6e..32169c43 100644 --- a/github/Github.py +++ b/github/Github.py @@ -1,5 +1,8 @@ from Requester import Requester -from GithubObjects import * +import GithubObjects.AuthenticatedUser +import GithubObjects.NamedUser +import GithubObjects.Organization +import GithubObjects.Gist class Github: def __init__( self, login, password, debugFile = None ): @@ -14,19 +17,20 @@ class Github: def get_user( self, login = None ): if login is None: - return AuthenticatedUser( self, {}, lazy = True ) + attributes = { "url": "https://api.github.com/user" } + return GithubObjects.AuthenticatedUser.AuthenticatedUser( self, attributes, lazy = True ) else: - return NamedUser( self, { "login": login }, lazy = False ) + return GithubObjects.NamedUser.NamedUser( self, { "login": login }, lazy = False ) def get_organization( self, login ): - return Organization( self, { "login": login }, lazy = False ) + return GithubObjects.Organization.Organization( self, { "login": login }, lazy = False ) def get_gist( self, id ): - return Gist( self, { "id": id }, lazy = False ) + return GithubObjects.Gist.Gist( self, { "id": id }, lazy = False ) def get_gists( self ): return [ - Gist( self, attributes, lazy = True ) + GithubObjects.Gist.Gist( self, attributes, lazy = True ) for attributes in self._dataRequest( "GET", "/gists/public", None, None ) ] diff --git a/github/GithubObjects/AuthenticatedUser.py b/github/GithubObjects/AuthenticatedUser.py index 22d7121f..0aef9b2a 100644 --- a/github/GithubObjects/AuthenticatedUser.py +++ b/github/GithubObjects/AuthenticatedUser.py @@ -1,94 +1,442 @@ -from Authorization import * -from UserKey import * -from Event import * -from NamedUser import * -from Organization import * -from Repository import * -from Gist import * -from Issue import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -def __getOrganizationEvents( user, org ): - return [ - Event( user._github, attributes, lazy = True ) - for attributes - in user._github._dataRequest( "GET", "/users/" + user.login + "/events/orgs/" + org.login, None, None ) - ] -def __createFork( user, repo ): - assert isinstance( repo, Repository ) - return Repository( user._github, user._github._dataRequest( "POST", repo._baseUrl() + "/forks", None, None ), lazy = True ) +class AuthenticatedUser( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) -def __getStaredGists( user ): - return [ - Gist( user._github, attributes, lazy = True ) - for attributes in user._github._dataRequest( "GET", "/gists/starred", None, None ) - ] + @property + def avatar_url( self ): + if self.__avatar_url is None: + self.__completeIfNeeded() + return self.__avatar_url -AuthenticatedUser = GithubObject( - "AuthenticatedUser", - BaseUrl( lambda obj: "/user" ), - Identity( lambda obj: obj.login ), - InternalSimpleAttributes( - "login", "id", "avatar_url", "gravatar_id", "url", "name", "company", - "blog", "location", "email", "hireable", "bio", "public_repos", - "public_gists", "followers", "following", "html_url", "created_at", - "type", "total_private_repos", "owned_private_repos", "private_gists", - "disk_usage", "collaborators", "plan", - ), - Editable( Parameters( [], [ "name", "email", "blog", "company", "location", "hireable", "bio" ] ) ), - ExternalListOfSimpleTypes( "emails", "email", "string", - ListGetable( Parameters( [], [] ) ), - SeveralElementsAddable(), - SeveralElementsRemovable() - ), - ExternalListOfObjects( "authorizations", "authorization", Authorization, - ListGetable( Parameters( [], [] ) ), - ElementGetable( Parameters( [ "id" ], [] ) ), - ElementCreatable( Parameters( [], [ "scopes", "note", "note_url" ] ) ), - url = "/authorizations", - ), - ExternalListOfObjects( "keys", "key", UserKey, - ListGetable( Parameters( [], [] ) ), - ElementGetable( Parameters( [ "id" ], [] ) ), - ElementCreatable( Parameters( [ "title", "key" ], [] ) ), - ), - ExternalListOfObjects( "events", "event", Event, - ListGetable( Parameters( [], [] ) ), - url = "/events" - ), - ExternalListOfObjects( "followers", "follower", NamedUser, - ListGetable( Parameters( [], [] ) ) - ), - ExternalListOfObjects( "following", "following", NamedUser, - ListGetable( Parameters( [], [] ) ), - ElementAddable(), - ElementRemovable(), - ElementHasable() - ), - ExternalListOfObjects( "orgs", "org", Organization, - ListGetable( Parameters( [], [] ) ) - ), - MethodFromCallable( "get_organization_events", Parameters( [ "org" ], [] ), __getOrganizationEvents, SimpleTypePolicy( "list of `Event`" ) ), - ExternalListOfObjects( "repos", "repo", Repository, - ListGetable( Parameters( [], [ "type" ] ) ), - ElementGetable( Parameters( [ "name" ], [] ), { "owner" : lambda user: { "login": user.login } } ), - ElementCreatable( Parameters( [ "name" ], [ "description", "homepage", "private", "has_issues", "has_wiki", "has_downloads", "team_id", ] ) ) - ), - ExternalListOfObjects( "watched", "watched", Repository, - ListGetable( Parameters( [], [] ) ), - ElementAddable(), - ElementRemovable(), - ElementHasable() - ), - SeveralAttributePolicies( [ MethodFromCallable( "create_fork", Parameters( [ "repo" ], [] ), __createFork, ObjectTypePolicy( Repository ) ) ], "Forking" ), - ExternalListOfObjects( "gists", "gist", Gist, - ListGetable( Parameters( [], [] ) ), - ElementCreatable( Parameters( [ "public", "files", ], [ "description" ] ) ), - url = "/gists", - ), - MethodFromCallable( "get_starred_gists", Parameters( [], [] ), __getStaredGists, SimpleTypePolicy( "list of `Gist`" ) ), - ExternalListOfObjects( "issues", "issue", Issue, - ListGetable( Parameters( [], [] ) ), - url = "/issues", - ), -) + @property + def bio( self ): + if self.__bio is None: + self.__completeIfNeeded() + return self.__bio + + @property + def blog( self ): + if self.__blog is None: + self.__completeIfNeeded() + return self.__blog + + @property + def collaborators( self ): + if self.__collaborators is None: + self.__completeIfNeeded() + return self.__collaborators + + @property + def company( self ): + if self.__company is None: + self.__completeIfNeeded() + return self.__company + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def disk_usage( self ): + if self.__disk_usage is None: + self.__completeIfNeeded() + return self.__disk_usage + + @property + def email( self ): + if self.__email is None: + self.__completeIfNeeded() + return self.__email + + @property + def followers( self ): + if self.__followers is None: + self.__completeIfNeeded() + return self.__followers + + @property + def following( self ): + if self.__following is None: + self.__completeIfNeeded() + return self.__following + + @property + def gravatar_id( self ): + if self.__gravatar_id is None: + self.__completeIfNeeded() + return self.__gravatar_id + + @property + def hireable( self ): + if self.__hireable is None: + self.__completeIfNeeded() + return self.__hireable + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def location( self ): + if self.__location is None: + self.__completeIfNeeded() + return self.__location + + @property + def login( self ): + if self.__login is None: + self.__completeIfNeeded() + return self.__login + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def owned_private_repos( self ): + if self.__owned_private_repos is None: + self.__completeIfNeeded() + return self.__owned_private_repos + + @property + def plan( self ): + if self.__plan is None: + self.__completeIfNeeded() + return self.__plan + + @property + def private_gists( self ): + if self.__private_gists is None: + self.__completeIfNeeded() + return self.__private_gists + + @property + def public_gists( self ): + if self.__public_gists is None: + self.__completeIfNeeded() + return self.__public_gists + + @property + def public_repos( self ): + if self.__public_repos is None: + self.__completeIfNeeded() + return self.__public_repos + + @property + def total_private_repos( self ): + if self.__total_private_repos is None: + self.__completeIfNeeded() + return self.__total_private_repos + + @property + def type( self ): + if self.__type is None: + self.__completeIfNeeded() + return self.__type + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__avatar_url = None + self.__bio = None + self.__blog = None + self.__collaborators = None + self.__company = None + self.__created_at = None + self.__disk_usage = None + self.__email = None + self.__followers = None + self.__following = None + self.__gravatar_id = None + self.__hireable = None + self.__html_url = None + self.__id = None + self.__location = None + self.__login = None + self.__name = None + self.__owned_private_repos = None + self.__plan = None + self.__private_gists = None + self.__public_gists = None + self.__public_repos = None + self.__total_private_repos = None + self.__type = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def add_to_emails( self, *emails ): + pass + + def add_to_following( self, following ): + pass + + def add_to_watched( self, watched ): + pass + + def create_authorization( self, scopes = None, note = None, note_url = None ): + pass + + def create_fork( self, repo ): + result = self.__github._dataRequest( + "POST", + "/repos/" + repo.owner.login + "/" + repo.name + "/forks", + None, + None + ) + return Repository.Repository( self.__github, result, lazy = True ) + + def create_gist( self, public, files, description = None ): + pass + + def create_key( self, title, key ): + pass + + def create_repo( self, name, description = None, homepage = None, private = None, has_issues = None, has_wiki = None, has_downloads = None, team_id = None ): + pass + + def edit( self, name = None, email = None, blog = None, company = None, location = None, hireable = None, bio = None ): + pass + + def get_authorization( self, id ): + pass + + def get_authorizations( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/authorizations", + None, + None + ) + return [ + Authorization.Authorization( self.__github, element, lazy = True ) + for element in result + ] + + def get_emails( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/emails", + None, + None + ) + return [ + string.string( self.__github, element, lazy = True ) + for element in result + ] + + def get_events( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/events", + None, + None + ) + return [ + Event.Event( self.__github, element, lazy = True ) + for element in result + ] + + def get_followers( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/followers", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_following( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/following", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_gists( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/gists", + None, + None + ) + return [ + Gist.Gist( self.__github, element, lazy = True ) + for element in result + ] + + def get_issues( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/issues", + None, + None + ) + return [ + Issue.Issue( self.__github, element, lazy = True ) + for element in result + ] + + def get_key( self, id ): + pass + + def get_keys( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/keys", + None, + None + ) + return [ + UserKey.UserKey( self.__github, element, lazy = True ) + for element in result + ] + + def get_organization_events( self, org ): + pass + + def get_orgs( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/orgs", + None, + None + ) + return [ + Organization.Organization( self.__github, element, lazy = True ) + for element in result + ] + + def get_repo( self, name ): + pass + + def get_repos( self, type = None ): + result = self.__github._dataRequest( + "GET", + self.url + "/repos", + None, + None + ) + return [ + Repository.Repository( self.__github, element, lazy = True ) + for element in result + ] + + def get_starred_gists( self ): + pass + + def get_watched( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/watched", + None, + None + ) + return [ + Repository.Repository( self.__github, element, lazy = True ) + for element in result + ] + + def has_in_following( self, following ): + pass + + def has_in_watched( self, watched ): + pass + + def remove_from_emails( self, *emails ): + pass + + def remove_from_following( self, following ): + pass + + def remove_from_watched( self, watched ): + pass + + def __useAttributes( self, attributes ): + if "avatar_url" in attributes: + self.__avatar_url = attributes[ "avatar_url" ] + if "bio" in attributes: + self.__bio = attributes[ "bio" ] + if "blog" in attributes: + self.__blog = attributes[ "blog" ] + if "collaborators" in attributes: + self.__collaborators = attributes[ "collaborators" ] + if "company" in attributes: + self.__company = attributes[ "company" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "disk_usage" in attributes: + self.__disk_usage = attributes[ "disk_usage" ] + if "email" in attributes: + self.__email = attributes[ "email" ] + if "followers" in attributes: + self.__followers = attributes[ "followers" ] + if "following" in attributes: + self.__following = attributes[ "following" ] + if "gravatar_id" in attributes: + self.__gravatar_id = attributes[ "gravatar_id" ] + if "hireable" in attributes: + self.__hireable = attributes[ "hireable" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "location" in attributes: + self.__location = attributes[ "location" ] + if "login" in attributes: + self.__login = attributes[ "login" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "owned_private_repos" in attributes: + self.__owned_private_repos = attributes[ "owned_private_repos" ] + if "plan" in attributes: + self.__plan = attributes[ "plan" ] + if "private_gists" in attributes: + self.__private_gists = attributes[ "private_gists" ] + if "public_gists" in attributes: + self.__public_gists = attributes[ "public_gists" ] + if "public_repos" in attributes: + self.__public_repos = attributes[ "public_repos" ] + if "total_private_repos" in attributes: + self.__total_private_repos = attributes[ "total_private_repos" ] + if "type" in attributes: + self.__type = attributes[ "type" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Authorization.py b/github/GithubObjects/Authorization.py index 2316041b..f7365436 100644 --- a/github/GithubObjects/Authorization.py +++ b/github/GithubObjects/Authorization.py @@ -1,12 +1,109 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -Authorization = GithubObject( - "Authorization", - BaseUrl( lambda obj: "/authorizations/" + str( obj.id ) ), - InternalSimpleAttributes( - "id", "url", "scopes", "token", "app", "note", "note_url", "updated_at", - "created_at", - ), - Editable( Parameters( [], [ "scopes", "add_scopes", "remove_scopes", "note", "note_url" ] ) ), - Deletable(), -) + +class Authorization( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def app( self ): + if self.__app is None: + self.__completeIfNeeded() + return self.__app + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def note( self ): + if self.__note is None: + self.__completeIfNeeded() + return self.__note + + @property + def note_url( self ): + if self.__note_url is None: + self.__completeIfNeeded() + return self.__note_url + + @property + def scopes( self ): + if self.__scopes is None: + self.__completeIfNeeded() + return self.__scopes + + @property + def token( self ): + if self.__token is None: + self.__completeIfNeeded() + return self.__token + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__app = None + self.__created_at = None + self.__id = None + self.__note = None + self.__note_url = None + self.__scopes = None + self.__token = None + self.__updated_at = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, scopes = None, add_scopes = None, remove_scopes = None, note = None, note_url = None ): + pass + + def __useAttributes( self, attributes ): + if "app" in attributes: + self.__app = attributes[ "app" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "note" in attributes: + self.__note = attributes[ "note" ] + if "note_url" in attributes: + self.__note_url = attributes[ "note_url" ] + if "scopes" in attributes: + self.__scopes = attributes[ "scopes" ] + if "token" in attributes: + self.__token = attributes[ "token" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Branch.py b/github/GithubObjects/Branch.py index 30fbebc5..87eadfa8 100644 --- a/github/GithubObjects/Branch.py +++ b/github/GithubObjects/Branch.py @@ -1,10 +1,40 @@ -from Commit import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -Branch = GithubObject( - "Branch", - InternalSimpleAttributes( - "name", - "_repo", - ), - InternalObjectAttribute( "commit", Commit ) -) + +class Branch( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def commit( self ): + if self.__commit is None: + self.__completeIfNeeded() + return self.__commit + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + def __initAttributes( self ): + self.__commit = None + self.__name = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "commit" in attributes: + self.__commit = attributes[ "commit" ] + if "name" in attributes: + self.__name = attributes[ "name" ] diff --git a/github/GithubObjects/Commit.py b/github/GithubObjects/Commit.py index 3a990227..c16948b2 100644 --- a/github/GithubObjects/Commit.py +++ b/github/GithubObjects/Commit.py @@ -1,24 +1,109 @@ -from GitCommit import * -from NamedUser import * -from CommitComment import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo } -Commit = GithubObject( - "Commit", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/commits/" + str( obj.sha ) ), - InternalSimpleAttributes( - "sha", "url", - "parents", - "stats", - "files", - "_repo", - ), - InternalObjectAttribute( "commit", GitCommit ), - InternalObjectAttribute( "author", NamedUser ), - InternalObjectAttribute( "committer", NamedUser ), - ExternalListOfObjects( "comments", "comment", CommitComment, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ), - ElementCreatable( Parameters( [ "body" ], [ "commit_id", "line", "path", "position" ] ), __modifyAttributesForObjectsReferingReferedRepo ), - ), -) +class Commit( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def author( self ): + if self.__author is None: + self.__completeIfNeeded() + return self.__author + + @property + def commit( self ): + if self.__commit is None: + self.__completeIfNeeded() + return self.__commit + + @property + def committer( self ): + if self.__committer is None: + self.__completeIfNeeded() + return self.__committer + + @property + def files( self ): + if self.__files is None: + self.__completeIfNeeded() + return self.__files + + @property + def parents( self ): + if self.__parents is None: + self.__completeIfNeeded() + return self.__parents + + @property + def sha( self ): + if self.__sha is None: + self.__completeIfNeeded() + return self.__sha + + @property + def stats( self ): + if self.__stats is None: + self.__completeIfNeeded() + return self.__stats + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__author = None + self.__commit = None + self.__committer = None + self.__files = None + self.__parents = None + self.__sha = None + self.__stats = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def create_comment( self, body, commit_id = None, line = None, path = None, position = None ): + pass + + def get_comments( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/comments", + None, + None + ) + return [ + CommitComment.CommitComment( self.__github, element, lazy = True ) + for element in result + ] + + def __useAttributes( self, attributes ): + if "author" in attributes: + self.__author = attributes[ "author" ] + if "commit" in attributes: + self.__commit = attributes[ "commit" ] + if "committer" in attributes: + self.__committer = attributes[ "committer" ] + if "files" in attributes: + self.__files = attributes[ "files" ] + if "parents" in attributes: + self.__parents = attributes[ "parents" ] + if "sha" in attributes: + self.__sha = attributes[ "sha" ] + if "stats" in attributes: + self.__stats = attributes[ "stats" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/CommitComment.py b/github/GithubObjects/CommitComment.py index 5bb93108..9cf5fbb8 100644 --- a/github/GithubObjects/CommitComment.py +++ b/github/GithubObjects/CommitComment.py @@ -1,14 +1,127 @@ -from NamedUser import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -CommitComment = GithubObject( - "CommitComment", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/comments/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "id", "body", "path", "position", "commit_id", - "created_at", "updated_at", "html_url", "line", - "_repo", - ), - InternalObjectAttribute( "user", NamedUser ), - Editable( Parameters( [ "body" ], [] ) ), - Deletable(), -) + +class CommitComment( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def body( self ): + if self.__body is None: + self.__completeIfNeeded() + return self.__body + + @property + def commit_id( self ): + if self.__commit_id is None: + self.__completeIfNeeded() + return self.__commit_id + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def line( self ): + if self.__line is None: + self.__completeIfNeeded() + return self.__line + + @property + def path( self ): + if self.__path is None: + self.__completeIfNeeded() + return self.__path + + @property + def position( self ): + if self.__position is None: + self.__completeIfNeeded() + return self.__position + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + @property + def user( self ): + if self.__user is None: + self.__completeIfNeeded() + return self.__user + + def __initAttributes( self ): + self.__body = None + self.__commit_id = None + self.__created_at = None + self.__html_url = None + self.__id = None + self.__line = None + self.__path = None + self.__position = None + self.__updated_at = None + self.__url = None + self.__user = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, body ): + pass + + def __useAttributes( self, attributes ): + if "body" in attributes: + self.__body = attributes[ "body" ] + if "commit_id" in attributes: + self.__commit_id = attributes[ "commit_id" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "line" in attributes: + self.__line = attributes[ "line" ] + if "path" in attributes: + self.__path = attributes[ "path" ] + if "position" in attributes: + self.__position = attributes[ "position" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] + if "user" in attributes: + self.__user = attributes[ "user" ] diff --git a/github/GithubObjects/Download.py b/github/GithubObjects/Download.py index a4577f31..74d5bbca 100644 --- a/github/GithubObjects/Download.py +++ b/github/GithubObjects/Download.py @@ -1,14 +1,205 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -Download = GithubObject( - "Download", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/downloads/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "html_url", "id", "name", "description", "size", - "download_count", "content_type", "policy", "signature", "bucket", - "accesskeyid", "path", "acl", "expirationdate", "prefix", "mime_type", - "redirect", "s3_url", "created_at", - "_repo", - ), - Deletable(), -) + +class Download( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def accesskeyid( self ): + if self.__accesskeyid is None: + self.__completeIfNeeded() + return self.__accesskeyid + + @property + def acl( self ): + if self.__acl is None: + self.__completeIfNeeded() + return self.__acl + + @property + def bucket( self ): + if self.__bucket is None: + self.__completeIfNeeded() + return self.__bucket + + @property + def content_type( self ): + if self.__content_type is None: + self.__completeIfNeeded() + return self.__content_type + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def description( self ): + if self.__description is None: + self.__completeIfNeeded() + return self.__description + + @property + def download_count( self ): + if self.__download_count is None: + self.__completeIfNeeded() + return self.__download_count + + @property + def expirationdate( self ): + if self.__expirationdate is None: + self.__completeIfNeeded() + return self.__expirationdate + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def mime_type( self ): + if self.__mime_type is None: + self.__completeIfNeeded() + return self.__mime_type + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def path( self ): + if self.__path is None: + self.__completeIfNeeded() + return self.__path + + @property + def policy( self ): + if self.__policy is None: + self.__completeIfNeeded() + return self.__policy + + @property + def prefix( self ): + if self.__prefix is None: + self.__completeIfNeeded() + return self.__prefix + + @property + def redirect( self ): + if self.__redirect is None: + self.__completeIfNeeded() + return self.__redirect + + @property + def s3_url( self ): + if self.__s3_url is None: + self.__completeIfNeeded() + return self.__s3_url + + @property + def signature( self ): + if self.__signature is None: + self.__completeIfNeeded() + return self.__signature + + @property + def size( self ): + if self.__size is None: + self.__completeIfNeeded() + return self.__size + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__accesskeyid = None + self.__acl = None + self.__bucket = None + self.__content_type = None + self.__created_at = None + self.__description = None + self.__download_count = None + self.__expirationdate = None + self.__html_url = None + self.__id = None + self.__mime_type = None + self.__name = None + self.__path = None + self.__policy = None + self.__prefix = None + self.__redirect = None + self.__s3_url = None + self.__signature = None + self.__size = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def __useAttributes( self, attributes ): + if "accesskeyid" in attributes: + self.__accesskeyid = attributes[ "accesskeyid" ] + if "acl" in attributes: + self.__acl = attributes[ "acl" ] + if "bucket" in attributes: + self.__bucket = attributes[ "bucket" ] + if "content_type" in attributes: + self.__content_type = attributes[ "content_type" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "description" in attributes: + self.__description = attributes[ "description" ] + if "download_count" in attributes: + self.__download_count = attributes[ "download_count" ] + if "expirationdate" in attributes: + self.__expirationdate = attributes[ "expirationdate" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "mime_type" in attributes: + self.__mime_type = attributes[ "mime_type" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "path" in attributes: + self.__path = attributes[ "path" ] + if "policy" in attributes: + self.__policy = attributes[ "policy" ] + if "prefix" in attributes: + self.__prefix = attributes[ "prefix" ] + if "redirect" in attributes: + self.__redirect = attributes[ "redirect" ] + if "s3_url" in attributes: + self.__s3_url = attributes[ "s3_url" ] + if "signature" in attributes: + self.__signature = attributes[ "signature" ] + if "size" in attributes: + self.__size = attributes[ "size" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Event.py b/github/GithubObjects/Event.py index 1cdb4e96..b6e87f9c 100644 --- a/github/GithubObjects/Event.py +++ b/github/GithubObjects/Event.py @@ -1,14 +1,130 @@ -from Repository import * -from NamedUser import * -from Organization import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -Event = GithubObject( - "Event", - InternalSimpleAttributes( - "type", "public", "payload", "created_at", "id", "commit_id", "url", - "event", "issue", - ), - InternalObjectAttribute( "repo", Repository ), - InternalObjectAttribute( "actor", NamedUser ), - InternalObjectAttribute( "org", Organization ), -) \ No newline at end of file + +class Event( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def actor( self ): + if self.__actor is None: + self.__completeIfNeeded() + return self.__actor + + @property + def commit_id( self ): + if self.__commit_id is None: + self.__completeIfNeeded() + return self.__commit_id + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def event( self ): + if self.__event is None: + self.__completeIfNeeded() + return self.__event + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def issue( self ): + if self.__issue is None: + self.__completeIfNeeded() + return self.__issue + + @property + def org( self ): + if self.__org is None: + self.__completeIfNeeded() + return self.__org + + @property + def payload( self ): + if self.__payload is None: + self.__completeIfNeeded() + return self.__payload + + @property + def public( self ): + if self.__public is None: + self.__completeIfNeeded() + return self.__public + + @property + def repo( self ): + if self.__repo is None: + self.__completeIfNeeded() + return self.__repo + + @property + def type( self ): + if self.__type is None: + self.__completeIfNeeded() + return self.__type + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__actor = None + self.__commit_id = None + self.__created_at = None + self.__event = None + self.__id = None + self.__issue = None + self.__org = None + self.__payload = None + self.__public = None + self.__repo = None + self.__type = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "actor" in attributes: + self.__actor = attributes[ "actor" ] + if "commit_id" in attributes: + self.__commit_id = attributes[ "commit_id" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "event" in attributes: + self.__event = attributes[ "event" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "issue" in attributes: + self.__issue = attributes[ "issue" ] + if "org" in attributes: + self.__org = attributes[ "org" ] + if "payload" in attributes: + self.__payload = attributes[ "payload" ] + if "public" in attributes: + self.__public = attributes[ "public" ] + if "repo" in attributes: + self.__repo = attributes[ "repo" ] + if "type" in attributes: + self.__type = attributes[ "type" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Gist.py b/github/GithubObjects/Gist.py index 771c33f7..b8579430 100644 --- a/github/GithubObjects/Gist.py +++ b/github/GithubObjects/Gist.py @@ -1,37 +1,184 @@ -from NamedUser import * -from GistComment import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -def __isStarred( gist ): - return gist._github._statusRequest( "GET", gist._baseUrl() + "/star", None, None ) == 204 -def __setStarred( gist ): - gist._github._statusRequest( "PUT", gist._baseUrl() + "/star", None, None ) -def __resetStarred( gist ): - gist._github._statusRequest( "DELETE", gist._baseUrl() + "/star", None, None ) -Gist = GithubObject( - "Gist", - BaseUrl( lambda obj: "/gists/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "id", "description", "public", "files", "comments", "html_url", - "git_pull_url", "git_push_url", "created_at", "forks", "history", - "updated_at", - ), - InternalObjectAttribute( "user", NamedUser ), - Editable( Parameters( [], [ "description", "files" ] ) ), - Deletable(), - ExternalListOfObjects( "comments", "comment", GistComment, - ListGetable( Parameters( [], [] ) ), - ElementGetable( Parameters( [ "id" ], [] ) ), - ElementCreatable( Parameters( [ "body" ], [] ) ), - ), - SeveralAttributePolicies( [ - MethodFromCallable( "is_starred", Parameters( [], [] ), __isStarred, SimpleTypePolicy( "bool" ) ), - MethodFromCallable( "set_starred", Parameters( [], [] ), __setStarred, SimpleTypePolicy( None ) ), - MethodFromCallable( "reset_starred", Parameters( [], [] ), __resetStarred, SimpleTypePolicy( None ) ), - ], "Starring" ), -) -def __createFork( gist ): - return Gist( gist._github, gist._github._dataRequest( "POST", gist._baseUrl() + "/fork", None, None ), lazy = True ) -Gist._addAttributePolicy( SeveralAttributePolicies( [ - MethodFromCallable( "create_fork", Parameters( [], [] ), __createFork, ObjectTypePolicy( Gist ) ), - ], "Forking" ), -) + +class Gist( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def comments( self ): + if self.__comments is None: + self.__completeIfNeeded() + return self.__comments + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def description( self ): + if self.__description is None: + self.__completeIfNeeded() + return self.__description + + @property + def files( self ): + if self.__files is None: + self.__completeIfNeeded() + return self.__files + + @property + def forks( self ): + if self.__forks is None: + self.__completeIfNeeded() + return self.__forks + + @property + def git_pull_url( self ): + if self.__git_pull_url is None: + self.__completeIfNeeded() + return self.__git_pull_url + + @property + def git_push_url( self ): + if self.__git_push_url is None: + self.__completeIfNeeded() + return self.__git_push_url + + @property + def history( self ): + if self.__history is None: + self.__completeIfNeeded() + return self.__history + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def public( self ): + if self.__public is None: + self.__completeIfNeeded() + return self.__public + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + @property + def user( self ): + if self.__user is None: + self.__completeIfNeeded() + return self.__user + + def __initAttributes( self ): + self.__comments = None + self.__created_at = None + self.__description = None + self.__files = None + self.__forks = None + self.__git_pull_url = None + self.__git_push_url = None + self.__history = None + self.__html_url = None + self.__id = None + self.__public = None + self.__updated_at = None + self.__url = None + self.__user = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def create_comment( self, body ): + pass + + def create_fork( self ): + pass + + def delete( self ): + pass + + def edit( self, description = None, files = None ): + pass + + def get_comment( self, id ): + pass + + def get_comments( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/comments", + None, + None + ) + return [ + GistComment.GistComment( self.__github, element, lazy = True ) + for element in result + ] + + def is_starred( self ): + pass + + def reset_starred( self ): + pass + + def set_starred( self ): + pass + + def __useAttributes( self, attributes ): + if "comments" in attributes: + self.__comments = attributes[ "comments" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "description" in attributes: + self.__description = attributes[ "description" ] + if "files" in attributes: + self.__files = attributes[ "files" ] + if "forks" in attributes: + self.__forks = attributes[ "forks" ] + if "git_pull_url" in attributes: + self.__git_pull_url = attributes[ "git_pull_url" ] + if "git_push_url" in attributes: + self.__git_push_url = attributes[ "git_push_url" ] + if "history" in attributes: + self.__history = attributes[ "history" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "public" in attributes: + self.__public = attributes[ "public" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] + if "user" in attributes: + self.__user = attributes[ "user" ] diff --git a/github/GithubObjects/GistComment.py b/github/GithubObjects/GistComment.py index 4fc4c442..aa139931 100644 --- a/github/GithubObjects/GistComment.py +++ b/github/GithubObjects/GistComment.py @@ -1,13 +1,82 @@ -from NamedUser import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -GistComment = GithubObject( - "GistComment", - BaseUrl( lambda obj: "/gists/comments/" + str( obj.id ) ), - InternalSimpleAttributes( - "id", "url", "body", "created_at", - "updated_at", - ), - InternalObjectAttribute( "user", NamedUser ), - Editable( Parameters( [ "body" ], [] ) ), - Deletable(), -) + +class GistComment( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def body( self ): + if self.__body is None: + self.__completeIfNeeded() + return self.__body + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + @property + def user( self ): + if self.__user is None: + self.__completeIfNeeded() + return self.__user + + def __initAttributes( self ): + self.__body = None + self.__created_at = None + self.__id = None + self.__updated_at = None + self.__url = None + self.__user = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, body ): + pass + + def __useAttributes( self, attributes ): + if "body" in attributes: + self.__body = attributes[ "body" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] + if "user" in attributes: + self.__user = attributes[ "user" ] diff --git a/github/GithubObjects/GitBlob.py b/github/GithubObjects/GitBlob.py index 607429fa..0429f4a6 100644 --- a/github/GithubObjects/GitBlob.py +++ b/github/GithubObjects/GitBlob.py @@ -1,11 +1,67 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -GitBlob = GithubObject( - "GitBlob", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/blobs/" + obj.sha ), - InternalSimpleAttributes( - "sha", "size", "url", - "content", "encoding", - "_repo", - ), -) + +class GitBlob( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def content( self ): + if self.__content is None: + self.__completeIfNeeded() + return self.__content + + @property + def encoding( self ): + if self.__encoding is None: + self.__completeIfNeeded() + return self.__encoding + + @property + def sha( self ): + if self.__sha is None: + self.__completeIfNeeded() + return self.__sha + + @property + def size( self ): + if self.__size is None: + self.__completeIfNeeded() + return self.__size + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__content = None + self.__encoding = None + self.__sha = None + self.__size = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "content" in attributes: + self.__content = attributes[ "content" ] + if "encoding" in attributes: + self.__encoding = attributes[ "encoding" ] + if "sha" in attributes: + self.__sha = attributes[ "sha" ] + if "size" in attributes: + self.__size = attributes[ "size" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/GitCommit.py b/github/GithubObjects/GitCommit.py index c9aa31c2..206c8e77 100644 --- a/github/GithubObjects/GitCommit.py +++ b/github/GithubObjects/GitCommit.py @@ -1,13 +1,85 @@ -from GitTree import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -GitCommit = GithubObject( - "GitCommit", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/commits/" + obj.sha ), - InternalSimpleAttributes( - "sha", "url", "message", - "parents", - "author", "committer", - "_repo", - ), - InternalObjectAttribute( "tree", GitTree ), -) + +class GitCommit( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def author( self ): + if self.__author is None: + self.__completeIfNeeded() + return self.__author + + @property + def committer( self ): + if self.__committer is None: + self.__completeIfNeeded() + return self.__committer + + @property + def message( self ): + if self.__message is None: + self.__completeIfNeeded() + return self.__message + + @property + def parents( self ): + if self.__parents is None: + self.__completeIfNeeded() + return self.__parents + + @property + def sha( self ): + if self.__sha is None: + self.__completeIfNeeded() + return self.__sha + + @property + def tree( self ): + if self.__tree is None: + self.__completeIfNeeded() + return self.__tree + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__author = None + self.__committer = None + self.__message = None + self.__parents = None + self.__sha = None + self.__tree = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "author" in attributes: + self.__author = attributes[ "author" ] + if "committer" in attributes: + self.__committer = attributes[ "committer" ] + if "message" in attributes: + self.__message = attributes[ "message" ] + if "parents" in attributes: + self.__parents = attributes[ "parents" ] + if "sha" in attributes: + self.__sha = attributes[ "sha" ] + if "tree" in attributes: + self.__tree = attributes[ "tree" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/GitRef.py b/github/GithubObjects/GitRef.py index f242e173..4c55b90c 100644 --- a/github/GithubObjects/GitRef.py +++ b/github/GithubObjects/GitRef.py @@ -1,13 +1,55 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -GitRef = GithubObject( - "GitRef", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/" + obj.ref ), - InternalSimpleAttributes( - "ref", "url", - "object", - "_repo", - ), - Editable( Parameters( [ "sha" ], [ "force" ] ) ), - Deletable(), -) + +class GitRef( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def object( self ): + if self.__object is None: + self.__completeIfNeeded() + return self.__object + + @property + def ref( self ): + if self.__ref is None: + self.__completeIfNeeded() + return self.__ref + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__object = None + self.__ref = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, sha, force = None ): + pass + + def __useAttributes( self, attributes ): + if "object" in attributes: + self.__object = attributes[ "object" ] + if "ref" in attributes: + self.__ref = attributes[ "ref" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/GitTag.py b/github/GithubObjects/GitTag.py index 9248ea61..fec53938 100644 --- a/github/GithubObjects/GitTag.py +++ b/github/GithubObjects/GitTag.py @@ -1,13 +1,76 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -GitTag = GithubObject( - "GitTag", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/tags/" + obj.sha ), - InternalSimpleAttributes( - "tag", "sha", "url", - "message", - "tagger", - "object", - "_repo", - ), -) + +class GitTag( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def message( self ): + if self.__message is None: + self.__completeIfNeeded() + return self.__message + + @property + def object( self ): + if self.__object is None: + self.__completeIfNeeded() + return self.__object + + @property + def sha( self ): + if self.__sha is None: + self.__completeIfNeeded() + return self.__sha + + @property + def tag( self ): + if self.__tag is None: + self.__completeIfNeeded() + return self.__tag + + @property + def tagger( self ): + if self.__tagger is None: + self.__completeIfNeeded() + return self.__tagger + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__message = None + self.__object = None + self.__sha = None + self.__tag = None + self.__tagger = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "message" in attributes: + self.__message = attributes[ "message" ] + if "object" in attributes: + self.__object = attributes[ "object" ] + if "sha" in attributes: + self.__sha = attributes[ "sha" ] + if "tag" in attributes: + self.__tag = attributes[ "tag" ] + if "tagger" in attributes: + self.__tagger = attributes[ "tagger" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/GitTree.py b/github/GithubObjects/GitTree.py index 61dac784..d823f004 100644 --- a/github/GithubObjects/GitTree.py +++ b/github/GithubObjects/GitTree.py @@ -1,11 +1,58 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -GitTree = GithubObject( - "GitTree", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/git/trees/" + obj.sha + ( "?recursive=1" if obj.recursive else "" ) ), - InternalSimpleAttributes( - "sha", "url", - "tree", - "_repo", "recursive", - ), -) + +class GitTree( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def recursive( self ): + if self.__recursive is None: + self.__completeIfNeeded() + return self.__recursive + + @property + def sha( self ): + if self.__sha is None: + self.__completeIfNeeded() + return self.__sha + + @property + def tree( self ): + if self.__tree is None: + self.__completeIfNeeded() + return self.__tree + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__recursive = None + self.__sha = None + self.__tree = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "recursive" in attributes: + self.__recursive = attributes[ "recursive" ] + if "sha" in attributes: + self.__sha = attributes[ "sha" ] + if "tree" in attributes: + self.__tree = attributes[ "tree" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/GithubObject/Basic.py b/github/GithubObjects/GithubObject/Basic.py index 2702c9f4..7bcb6965 100644 --- a/github/GithubObjects/GithubObject/Basic.py +++ b/github/GithubObjects/GithubObject/Basic.py @@ -114,5 +114,5 @@ class SeveralAttributePolicies: doc += "\n" doc += self.__documentationSection + "\n" doc += "-" * len( self.__documentationSection ) + "\n" - doc += "".join( attributePolicy.autoDocument() for attributePolicy in self.__attributePolicies ) + doc += "".join( sorted( attributePolicy.autoDocument() for attributePolicy in self.__attributePolicies ) ) return doc diff --git a/github/GithubObjects/Hook.py b/github/GithubObjects/Hook.py index 36dc1354..ac1952c6 100644 --- a/github/GithubObjects/Hook.py +++ b/github/GithubObjects/Hook.py @@ -1,16 +1,112 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -def __testHook( hook ): - hook._github._statusRequest( "POST", hook._baseUrl() + "/test", None, None ) -Hook = GithubObject( - "Hook", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/hooks/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "updated_at", "created_at", "name", "events", "active", "config", - "id", "last_response", - "_repo", - ), - Editable( Parameters( [ "name", "config" ], [ "events", "add_events", "remove_events", "active" ] ) ), - Deletable(), - SeveralAttributePolicies( [ MethodFromCallable( "test", Parameters( [], [] ), __testHook, SimpleTypePolicy( None ) ) ], "Testing" ) -) + +class Hook( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def active( self ): + if self.__active is None: + self.__completeIfNeeded() + return self.__active + + @property + def config( self ): + if self.__config is None: + self.__completeIfNeeded() + return self.__config + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def events( self ): + if self.__events is None: + self.__completeIfNeeded() + return self.__events + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def last_response( self ): + if self.__last_response is None: + self.__completeIfNeeded() + return self.__last_response + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__active = None + self.__config = None + self.__created_at = None + self.__events = None + self.__id = None + self.__last_response = None + self.__name = None + self.__updated_at = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, name, config, events = None, add_events = None, remove_events = None, active = None ): + pass + + def test( self ): + pass + + def __useAttributes( self, attributes ): + if "active" in attributes: + self.__active = attributes[ "active" ] + if "config" in attributes: + self.__config = attributes[ "config" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "events" in attributes: + self.__events = attributes[ "events" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "last_response" in attributes: + self.__last_response = attributes[ "last_response" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Issue.py b/github/GithubObjects/Issue.py index 13c2f05a..58475006 100644 --- a/github/GithubObjects/Issue.py +++ b/github/GithubObjects/Issue.py @@ -1,37 +1,232 @@ -from NamedUser import * -from Milestone import * -from Label import * -from IssueComment import * -from IssueEvent import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo } -Issue = GithubObject( - "Issue", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/" + str( obj.number ) ), - InternalSimpleAttributes( - "url", "html_url", "number", "state", "title", "body", "labels", - "comments", "closed_at", "created_at", "updated_at", "id", "closed_by", - "pull_request", - "_repo", - ), - InternalObjectAttribute( "user", NamedUser ), - InternalObjectAttribute( "assignee", NamedUser ), - InternalObjectAttribute( "milestone", Milestone ), - Editable( Parameters( [], [ "title", "body", "assignee", "state", "milestone", "labels" ] ) ), - ExternalListOfObjects( "labels", "label", Label, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ), - SeveralElementsAddable(), - ListSetable(), - ListDeletable(), - ElementRemovable(), - ), - ExternalListOfObjects( "comments", "comment", IssueComment, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ), - ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingReferedRepo ), - ElementCreatable( Parameters( [ "body" ], [] ), __modifyAttributesForObjectsReferingReferedRepo ), - ), - ExternalListOfObjects( "events", "event", IssueEvent, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ) - ), -) +class Issue( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def assignee( self ): + if self.__assignee is None: + self.__completeIfNeeded() + return self.__assignee + + @property + def body( self ): + if self.__body is None: + self.__completeIfNeeded() + return self.__body + + @property + def closed_at( self ): + if self.__closed_at is None: + self.__completeIfNeeded() + return self.__closed_at + + @property + def closed_by( self ): + if self.__closed_by is None: + self.__completeIfNeeded() + return self.__closed_by + + @property + def comments( self ): + if self.__comments is None: + self.__completeIfNeeded() + return self.__comments + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def labels( self ): + if self.__labels is None: + self.__completeIfNeeded() + return self.__labels + + @property + def milestone( self ): + if self.__milestone is None: + self.__completeIfNeeded() + return self.__milestone + + @property + def number( self ): + if self.__number is None: + self.__completeIfNeeded() + return self.__number + + @property + def pull_request( self ): + if self.__pull_request is None: + self.__completeIfNeeded() + return self.__pull_request + + @property + def state( self ): + if self.__state is None: + self.__completeIfNeeded() + return self.__state + + @property + def title( self ): + if self.__title is None: + self.__completeIfNeeded() + return self.__title + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + @property + def user( self ): + if self.__user is None: + self.__completeIfNeeded() + return self.__user + + def __initAttributes( self ): + self.__assignee = None + self.__body = None + self.__closed_at = None + self.__closed_by = None + self.__comments = None + self.__created_at = None + self.__html_url = None + self.__id = None + self.__labels = None + self.__milestone = None + self.__number = None + self.__pull_request = None + self.__state = None + self.__title = None + self.__updated_at = None + self.__url = None + self.__user = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def add_to_labels( self, *labels ): + pass + + def create_comment( self, body ): + pass + + def delete_labels( self ): + pass + + def edit( self, title = None, body = None, assignee = None, state = None, milestone = None, labels = None ): + pass + + def get_comment( self, id ): + pass + + def get_comments( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/comments", + None, + None + ) + return [ + IssueComment.IssueComment( self.__github, element, lazy = True ) + for element in result + ] + + def get_events( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/events", + None, + None + ) + return [ + IssueEvent.IssueEvent( self.__github, element, lazy = True ) + for element in result + ] + + def get_labels( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/labels", + None, + None + ) + return [ + Label.Label( self.__github, element, lazy = True ) + for element in result + ] + + def remove_from_labels( self, label ): + pass + + def set_labels( self, *labels ): + pass + + def __useAttributes( self, attributes ): + if "assignee" in attributes: + self.__assignee = attributes[ "assignee" ] + if "body" in attributes: + self.__body = attributes[ "body" ] + if "closed_at" in attributes: + self.__closed_at = attributes[ "closed_at" ] + if "closed_by" in attributes: + self.__closed_by = attributes[ "closed_by" ] + if "comments" in attributes: + self.__comments = attributes[ "comments" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "labels" in attributes: + self.__labels = attributes[ "labels" ] + if "milestone" in attributes: + self.__milestone = attributes[ "milestone" ] + if "number" in attributes: + self.__number = attributes[ "number" ] + if "pull_request" in attributes: + self.__pull_request = attributes[ "pull_request" ] + if "state" in attributes: + self.__state = attributes[ "state" ] + if "title" in attributes: + self.__title = attributes[ "title" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] + if "user" in attributes: + self.__user = attributes[ "user" ] diff --git a/github/GithubObjects/IssueComment.py b/github/GithubObjects/IssueComment.py index fb812b33..fb169b03 100644 --- a/github/GithubObjects/IssueComment.py +++ b/github/GithubObjects/IssueComment.py @@ -1,13 +1,82 @@ -from NamedUser import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -IssueComment = GithubObject( - "IssueComment", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/comments/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "body", "created_at", "updated_at", "id", - "_repo", - ), - InternalObjectAttribute( "user", NamedUser ), - Editable( Parameters( [ "body" ], [] ) ), - Deletable(), -) + +class IssueComment( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def body( self ): + if self.__body is None: + self.__completeIfNeeded() + return self.__body + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + @property + def user( self ): + if self.__user is None: + self.__completeIfNeeded() + return self.__user + + def __initAttributes( self ): + self.__body = None + self.__created_at = None + self.__id = None + self.__updated_at = None + self.__url = None + self.__user = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, body ): + pass + + def __useAttributes( self, attributes ): + if "body" in attributes: + self.__body = attributes[ "body" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] + if "user" in attributes: + self.__user = attributes[ "user" ] diff --git a/github/GithubObjects/IssueEvent.py b/github/GithubObjects/IssueEvent.py index c5b6fd29..eec67f2c 100644 --- a/github/GithubObjects/IssueEvent.py +++ b/github/GithubObjects/IssueEvent.py @@ -1,11 +1,85 @@ -from NamedUser import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -IssueEvent = GithubObject( - "IssueEvent", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/events/" + str( obj.id ) ), - InternalSimpleAttributes( - "id", "url", "created_at", "issue", "event", "commit_id", - "_repo", - ), - InternalObjectAttribute( "actor", NamedUser ), -) + +class IssueEvent( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def actor( self ): + if self.__actor is None: + self.__completeIfNeeded() + return self.__actor + + @property + def commit_id( self ): + if self.__commit_id is None: + self.__completeIfNeeded() + return self.__commit_id + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def event( self ): + if self.__event is None: + self.__completeIfNeeded() + return self.__event + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def issue( self ): + if self.__issue is None: + self.__completeIfNeeded() + return self.__issue + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__actor = None + self.__commit_id = None + self.__created_at = None + self.__event = None + self.__id = None + self.__issue = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "actor" in attributes: + self.__actor = attributes[ "actor" ] + if "commit_id" in attributes: + self.__commit_id = attributes[ "commit_id" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "event" in attributes: + self.__event = attributes[ "event" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "issue" in attributes: + self.__issue = attributes[ "issue" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Label.py b/github/GithubObjects/Label.py index aec594f9..25a6e764 100644 --- a/github/GithubObjects/Label.py +++ b/github/GithubObjects/Label.py @@ -1,15 +1,55 @@ -import urllib +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -from GithubObject import * -Label = GithubObject( - "Label", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/labels/" + obj._identity ), - Identity( lambda obj: urllib.quote( obj.name ) ), - InternalSimpleAttributes( - "url", "name", "color", - "_repo", - ), - Editable( Parameters( [ "name", "color" ], [] ) ), - Deletable(), -) +class Label( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def color( self ): + if self.__color is None: + self.__completeIfNeeded() + return self.__color + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__color = None + self.__name = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, name, color ): + pass + + def __useAttributes( self, attributes ): + if "color" in attributes: + self.__color = attributes[ "color" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Milestone.py b/github/GithubObjects/Milestone.py index 7cd1bc0d..703ea9f5 100644 --- a/github/GithubObjects/Milestone.py +++ b/github/GithubObjects/Milestone.py @@ -1,20 +1,130 @@ -from NamedUser import * -from Label import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo } -Milestone = GithubObject( - "Milestone", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/milestones/" + str( obj.number ) ), - InternalSimpleAttributes( - "url", "number", "state", "title", "description", "open_issues", - "closed_issues", "created_at", "due_on", - "_repo", - ), - InternalObjectAttribute( "creator", NamedUser ), - Editable( Parameters( [ "title" ], [ "state", "description", "due_on" ] ) ), - Deletable(), - ExternalListOfObjects( "labels", "label", Label, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ) - ), -) +class Milestone( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def closed_issues( self ): + if self.__closed_issues is None: + self.__completeIfNeeded() + return self.__closed_issues + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def creator( self ): + if self.__creator is None: + self.__completeIfNeeded() + return self.__creator + + @property + def description( self ): + if self.__description is None: + self.__completeIfNeeded() + return self.__description + + @property + def due_on( self ): + if self.__due_on is None: + self.__completeIfNeeded() + return self.__due_on + + @property + def number( self ): + if self.__number is None: + self.__completeIfNeeded() + return self.__number + + @property + def open_issues( self ): + if self.__open_issues is None: + self.__completeIfNeeded() + return self.__open_issues + + @property + def state( self ): + if self.__state is None: + self.__completeIfNeeded() + return self.__state + + @property + def title( self ): + if self.__title is None: + self.__completeIfNeeded() + return self.__title + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__closed_issues = None + self.__created_at = None + self.__creator = None + self.__description = None + self.__due_on = None + self.__number = None + self.__open_issues = None + self.__state = None + self.__title = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, title, state = None, description = None, due_on = None ): + pass + + def get_labels( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/labels", + None, + None + ) + return [ + Label.Label( self.__github, element, lazy = True ) + for element in result + ] + + def __useAttributes( self, attributes ): + if "closed_issues" in attributes: + self.__closed_issues = attributes[ "closed_issues" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "creator" in attributes: + self.__creator = attributes[ "creator" ] + if "description" in attributes: + self.__description = attributes[ "description" ] + if "due_on" in attributes: + self.__due_on = attributes[ "due_on" ] + if "number" in attributes: + self.__number = attributes[ "number" ] + if "open_issues" in attributes: + self.__open_issues = attributes[ "open_issues" ] + if "state" in attributes: + self.__state = attributes[ "state" ] + if "title" in attributes: + self.__title = attributes[ "title" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/NamedUser.py b/github/GithubObjects/NamedUser.py index c460d2f2..e352ee20 100644 --- a/github/GithubObjects/NamedUser.py +++ b/github/GithubObjects/NamedUser.py @@ -1,30 +1,355 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -NamedUser = GithubObject( - "NamedUser", - BaseUrl( lambda obj: "/users/" + obj.login ), - Identity( lambda obj: obj.login ), - InternalSimpleAttributes( - "login", "id", "avatar_url", "gravatar_id", "url", "name", "company", - "blog", "location", "email", "hireable", "bio", "public_repos", - "public_gists", "followers", "following", "html_url", "created_at", - "type", - # Only in Repository.get_contributors() - "contributions", - # Seen only by user herself - "disk_usage", "collaborators", "plan", "total_private_repos", - "owned_private_repos", "private_gists", - ), -) -NamedUser._addAttributePolicy( - ExternalListOfObjects( "followers", "follower", NamedUser, - ListGetable( Parameters( [], [] ) ) - ) -) +class NamedUser( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) -NamedUser._addAttributePolicy( - ExternalListOfObjects( "following", "following", NamedUser, - ListGetable( Parameters( [], [] ) ) - ) -) + @property + def avatar_url( self ): + if self.__avatar_url is None: + self.__completeIfNeeded() + return self.__avatar_url + + @property + def bio( self ): + if self.__bio is None: + self.__completeIfNeeded() + return self.__bio + + @property + def blog( self ): + if self.__blog is None: + self.__completeIfNeeded() + return self.__blog + + @property + def collaborators( self ): + if self.__collaborators is None: + self.__completeIfNeeded() + return self.__collaborators + + @property + def company( self ): + if self.__company is None: + self.__completeIfNeeded() + return self.__company + + @property + def contributions( self ): + if self.__contributions is None: + self.__completeIfNeeded() + return self.__contributions + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def disk_usage( self ): + if self.__disk_usage is None: + self.__completeIfNeeded() + return self.__disk_usage + + @property + def email( self ): + if self.__email is None: + self.__completeIfNeeded() + return self.__email + + @property + def followers( self ): + if self.__followers is None: + self.__completeIfNeeded() + return self.__followers + + @property + def following( self ): + if self.__following is None: + self.__completeIfNeeded() + return self.__following + + @property + def gravatar_id( self ): + if self.__gravatar_id is None: + self.__completeIfNeeded() + return self.__gravatar_id + + @property + def hireable( self ): + if self.__hireable is None: + self.__completeIfNeeded() + return self.__hireable + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def location( self ): + if self.__location is None: + self.__completeIfNeeded() + return self.__location + + @property + def login( self ): + if self.__login is None: + self.__completeIfNeeded() + return self.__login + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def owned_private_repos( self ): + if self.__owned_private_repos is None: + self.__completeIfNeeded() + return self.__owned_private_repos + + @property + def plan( self ): + if self.__plan is None: + self.__completeIfNeeded() + return self.__plan + + @property + def private_gists( self ): + if self.__private_gists is None: + self.__completeIfNeeded() + return self.__private_gists + + @property + def public_gists( self ): + if self.__public_gists is None: + self.__completeIfNeeded() + return self.__public_gists + + @property + def public_repos( self ): + if self.__public_repos is None: + self.__completeIfNeeded() + return self.__public_repos + + @property + def total_private_repos( self ): + if self.__total_private_repos is None: + self.__completeIfNeeded() + return self.__total_private_repos + + @property + def type( self ): + if self.__type is None: + self.__completeIfNeeded() + return self.__type + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__avatar_url = None + self.__bio = None + self.__blog = None + self.__collaborators = None + self.__company = None + self.__contributions = None + self.__created_at = None + self.__disk_usage = None + self.__email = None + self.__followers = None + self.__following = None + self.__gravatar_id = None + self.__hireable = None + self.__html_url = None + self.__id = None + self.__location = None + self.__login = None + self.__name = None + self.__owned_private_repos = None + self.__plan = None + self.__private_gists = None + self.__public_gists = None + self.__public_repos = None + self.__total_private_repos = None + self.__type = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def create_gist( self, public, files, description = None ): + pass + + def get_events( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/events", + None, + None + ) + return [ + Event.Event( self.__github, element, lazy = True ) + for element in result + ] + + def get_followers( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/followers", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_following( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/following", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_gists( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/gists", + None, + None + ) + return [ + Gist.Gist( self.__github, element, lazy = True ) + for element in result + ] + + def get_orgs( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/orgs", + None, + None + ) + return [ + Organization.Organization( self.__github, element, lazy = True ) + for element in result + ] + + def get_public_events( self ): + pass + + def get_public_received_events( self ): + pass + + def get_received_events( self ): + pass + + def get_repo( self, name ): + pass + + def get_repos( self, type = None ): + result = self.__github._dataRequest( + "GET", + self.url + "/repos", + None, + None + ) + return [ + Repository.Repository( self.__github, element, lazy = True ) + for element in result + ] + + def get_watched( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/watched", + None, + None + ) + return [ + Repository.Repository( self.__github, element, lazy = True ) + for element in result + ] + + def __useAttributes( self, attributes ): + if "avatar_url" in attributes: + self.__avatar_url = attributes[ "avatar_url" ] + if "bio" in attributes: + self.__bio = attributes[ "bio" ] + if "blog" in attributes: + self.__blog = attributes[ "blog" ] + if "collaborators" in attributes: + self.__collaborators = attributes[ "collaborators" ] + if "company" in attributes: + self.__company = attributes[ "company" ] + if "contributions" in attributes: + self.__contributions = attributes[ "contributions" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "disk_usage" in attributes: + self.__disk_usage = attributes[ "disk_usage" ] + if "email" in attributes: + self.__email = attributes[ "email" ] + if "followers" in attributes: + self.__followers = attributes[ "followers" ] + if "following" in attributes: + self.__following = attributes[ "following" ] + if "gravatar_id" in attributes: + self.__gravatar_id = attributes[ "gravatar_id" ] + if "hireable" in attributes: + self.__hireable = attributes[ "hireable" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "location" in attributes: + self.__location = attributes[ "location" ] + if "login" in attributes: + self.__login = attributes[ "login" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "owned_private_repos" in attributes: + self.__owned_private_repos = attributes[ "owned_private_repos" ] + if "plan" in attributes: + self.__plan = attributes[ "plan" ] + if "private_gists" in attributes: + self.__private_gists = attributes[ "private_gists" ] + if "public_gists" in attributes: + self.__public_gists = attributes[ "public_gists" ] + if "public_repos" in attributes: + self.__public_repos = attributes[ "public_repos" ] + if "total_private_repos" in attributes: + self.__total_private_repos = attributes[ "total_private_repos" ] + if "type" in attributes: + self.__type = attributes[ "type" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/NamedUser_complete.py b/github/GithubObjects/NamedUser_complete.py deleted file mode 100644 index 74c170d1..00000000 --- a/github/GithubObjects/NamedUser_complete.py +++ /dev/null @@ -1,66 +0,0 @@ -from NamedUser import * - -from Organization import * -from Event import * -from Repository import * -from Gist import * - -NamedUser._addAttributePolicy( - ExternalListOfObjects( "orgs", "org", Organization, - ListGetable( Parameters( [], [] ) ) - ) -) - -NamedUser._addAttributePolicy( - ExternalListOfObjects( "events", "event", Event, - ListGetable( Parameters( [], [] ) ) - ) -) - -def __getPublicEvents( user ): - return [ - Event( user._github, attributes, lazy = True ) - for attributes - in user._github._dataRequest( "GET", user._baseUrl() + "/events/public", None, None ) - ] - -NamedUser._addAttributePolicy( - MethodFromCallable( "get_public_events", Parameters( [], [] ), __getPublicEvents, SimpleTypePolicy( "list of `Event`" ) ) -) - -NamedUser._addAttributePolicy( - ExternalListOfObjects( "received_events", "received_event", Event, - ListGetable( Parameters( [], [] ) ) - ) -) - -def __getPublicReceivedEvents( user ): - return [ - Event( user._github, attributes, lazy = True ) - for attributes - in user._github._dataRequest( "GET", user._baseUrl() + "/received_events/public", None, None ) - ] - -NamedUser._addAttributePolicy( - MethodFromCallable( "get_public_received_events", Parameters( [], [] ), __getPublicReceivedEvents, SimpleTypePolicy( "list of `Event`" ) ) -) - -NamedUser._addAttributePolicy( - ExternalListOfObjects( "repos", "repo", Repository, - ListGetable( Parameters( [], [ "type" ] ) ), - ElementGetable( Parameters( [ "name" ], [] ), { "owner" : lambda user: { "login": user.login } } ) - ) -) - -NamedUser._addAttributePolicy( - ExternalListOfObjects( "watched", "watched", Repository, - ListGetable( Parameters( [], [] ) ) - ) -) - -NamedUser._addAttributePolicy( - ExternalListOfObjects( "gists", "gist", Gist, - ListGetable( Parameters( [], [] ) ), - ElementCreatable( Parameters( [ "public", "files" ], [ "description" ] ) ), - ) -) diff --git a/github/GithubObjects/Organization.py b/github/GithubObjects/Organization.py index 3fb7adc1..b27acf31 100644 --- a/github/GithubObjects/Organization.py +++ b/github/GithubObjects/Organization.py @@ -1,27 +1,328 @@ -from NamedUser import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -Organization = GithubObject( - "Organization", - BaseUrl( lambda obj: "/orgs/" + obj.login ), - Identity( lambda obj: obj.login ), - InternalSimpleAttributes( - "login", "id", "url", "avatar_url", "name", "company", "blog", - "location", "email", "public_repos", "public_gists", "followers", - "following", "html_url", "created_at", "type", "gravatar_id", - # Seen only by owners - "disk_usage", "collaborators", "billing_email", "plan", "private_gists", - "total_private_repos", "owned_private_repos", - ), - Editable( Parameters( [], [ "billing_email", "blog", "company", "email", "location", "name" ] ) ), - ExternalListOfObjects( "public_members", "public_member", NamedUser, - ListGetable( Parameters( [], [] ) ), - ElementAddable(), - ElementRemovable(), - ElementHasable() - ), - ExternalListOfObjects( "members", "member", NamedUser, - ListGetable( Parameters( [], [] ) ), - ElementRemovable(), - ElementHasable() - ), -) + +class Organization( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def avatar_url( self ): + if self.__avatar_url is None: + self.__completeIfNeeded() + return self.__avatar_url + + @property + def billing_email( self ): + if self.__billing_email is None: + self.__completeIfNeeded() + return self.__billing_email + + @property + def blog( self ): + if self.__blog is None: + self.__completeIfNeeded() + return self.__blog + + @property + def collaborators( self ): + if self.__collaborators is None: + self.__completeIfNeeded() + return self.__collaborators + + @property + def company( self ): + if self.__company is None: + self.__completeIfNeeded() + return self.__company + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def disk_usage( self ): + if self.__disk_usage is None: + self.__completeIfNeeded() + return self.__disk_usage + + @property + def email( self ): + if self.__email is None: + self.__completeIfNeeded() + return self.__email + + @property + def followers( self ): + if self.__followers is None: + self.__completeIfNeeded() + return self.__followers + + @property + def following( self ): + if self.__following is None: + self.__completeIfNeeded() + return self.__following + + @property + def gravatar_id( self ): + if self.__gravatar_id is None: + self.__completeIfNeeded() + return self.__gravatar_id + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def location( self ): + if self.__location is None: + self.__completeIfNeeded() + return self.__location + + @property + def login( self ): + if self.__login is None: + self.__completeIfNeeded() + return self.__login + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def owned_private_repos( self ): + if self.__owned_private_repos is None: + self.__completeIfNeeded() + return self.__owned_private_repos + + @property + def plan( self ): + if self.__plan is None: + self.__completeIfNeeded() + return self.__plan + + @property + def private_gists( self ): + if self.__private_gists is None: + self.__completeIfNeeded() + return self.__private_gists + + @property + def public_gists( self ): + if self.__public_gists is None: + self.__completeIfNeeded() + return self.__public_gists + + @property + def public_repos( self ): + if self.__public_repos is None: + self.__completeIfNeeded() + return self.__public_repos + + @property + def total_private_repos( self ): + if self.__total_private_repos is None: + self.__completeIfNeeded() + return self.__total_private_repos + + @property + def type( self ): + if self.__type is None: + self.__completeIfNeeded() + return self.__type + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__avatar_url = None + self.__billing_email = None + self.__blog = None + self.__collaborators = None + self.__company = None + self.__created_at = None + self.__disk_usage = None + self.__email = None + self.__followers = None + self.__following = None + self.__gravatar_id = None + self.__html_url = None + self.__id = None + self.__location = None + self.__login = None + self.__name = None + self.__owned_private_repos = None + self.__plan = None + self.__private_gists = None + self.__public_gists = None + self.__public_repos = None + self.__total_private_repos = None + self.__type = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def add_to_public_members( self, public_member ): + pass + + def create_fork( self, repo ): + pass + + def create_repo( self, name, description = None, homepage = None, private = None, has_issues = None, has_wiki = None, has_downloads = None, team_id = None ): + pass + + def create_team( self, name, repo_names = None, permission = None ): + pass + + def edit( self, billing_email = None, blog = None, company = None, email = None, location = None, name = None ): + pass + + def get_events( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/events", + None, + None + ) + return [ + Event.Event( self.__github, element, lazy = True ) + for element in result + ] + + def get_members( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/members", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_public_members( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/public_members", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_repo( self, name ): + pass + + def get_repos( self, type = None ): + result = self.__github._dataRequest( + "GET", + self.url + "/repos", + None, + None + ) + return [ + Repository.Repository( self.__github, element, lazy = True ) + for element in result + ] + + def get_teams( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/teams", + None, + None + ) + return [ + Team.Team( self.__github, element, lazy = True ) + for element in result + ] + + def has_in_members( self, member ): + pass + + def has_in_public_members( self, public_member ): + pass + + def remove_from_members( self, member ): + pass + + def remove_from_public_members( self, public_member ): + pass + + def __useAttributes( self, attributes ): + if "avatar_url" in attributes: + self.__avatar_url = attributes[ "avatar_url" ] + if "billing_email" in attributes: + self.__billing_email = attributes[ "billing_email" ] + if "blog" in attributes: + self.__blog = attributes[ "blog" ] + if "collaborators" in attributes: + self.__collaborators = attributes[ "collaborators" ] + if "company" in attributes: + self.__company = attributes[ "company" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "disk_usage" in attributes: + self.__disk_usage = attributes[ "disk_usage" ] + if "email" in attributes: + self.__email = attributes[ "email" ] + if "followers" in attributes: + self.__followers = attributes[ "followers" ] + if "following" in attributes: + self.__following = attributes[ "following" ] + if "gravatar_id" in attributes: + self.__gravatar_id = attributes[ "gravatar_id" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "location" in attributes: + self.__location = attributes[ "location" ] + if "login" in attributes: + self.__login = attributes[ "login" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "owned_private_repos" in attributes: + self.__owned_private_repos = attributes[ "owned_private_repos" ] + if "plan" in attributes: + self.__plan = attributes[ "plan" ] + if "private_gists" in attributes: + self.__private_gists = attributes[ "private_gists" ] + if "public_gists" in attributes: + self.__public_gists = attributes[ "public_gists" ] + if "public_repos" in attributes: + self.__public_repos = attributes[ "public_repos" ] + if "total_private_repos" in attributes: + self.__total_private_repos = attributes[ "total_private_repos" ] + if "type" in attributes: + self.__type = attributes[ "type" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Organization_complete.py b/github/GithubObjects/Organization_complete.py deleted file mode 100644 index dd1096ae..00000000 --- a/github/GithubObjects/Organization_complete.py +++ /dev/null @@ -1,34 +0,0 @@ -from Organization import * - -from Repository import * -from Team import * -from Event import * - -Organization._addAttributePolicy( - ExternalListOfObjects( "repos", "repo", Repository, - ListGetable( Parameters( [], [ "type" ] ) ), - ElementGetable( Parameters( [ "name" ], [] ), { "owner" : lambda user: { "login": user.login } } ), - ElementCreatable( Parameters( [ "name" ], [ "description", "homepage", "private", "has_issues", "has_wiki", "has_downloads", "team_id", ] ) ) - ) -) - -def __createForkForOrg( org, repo ): - assert isinstance( repo, Repository ) - return Repository( org._github, org._github._dataRequest( "POST", repo._baseUrl() + "/forks", { "org": org.login }, None ), lazy = True ) - -Organization._addAttributePolicy( - SeveralAttributePolicies( [ MethodFromCallable( "create_fork", Parameters( [ "repo" ], [] ), __createForkForOrg, ObjectTypePolicy( Repository ) ) ], "Forking" ) -) - -Organization._addAttributePolicy( - ExternalListOfObjects( "teams", "team", Team, - ListGetable( Parameters( [], [] ) ), - ElementCreatable( Parameters( [ "name" ], [ "repo_names", "permission" ] ) ) - ) -) - -Organization._addAttributePolicy( - ExternalListOfObjects( "events", "event", Event, - ListGetable( Parameters( [], [] ) ) - ), -) diff --git a/github/GithubObjects/PullRequest.py b/github/GithubObjects/PullRequest.py index 5ee414d5..1ea0b603 100644 --- a/github/GithubObjects/PullRequest.py +++ b/github/GithubObjects/PullRequest.py @@ -1,40 +1,304 @@ -from NamedUser import * -from Commit import * -from PullRequestFile import * -from PullRequestComment import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -__modifyAttributesForObjectsReferingReferedRepo = { "_repo": lambda obj: obj._repo } -def __pullRequestIsMerged( r ): - return r._github._statusRequest( "GET", r._baseUrl() + "/merge", None, None ) == 204 +class PullRequest( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) -def __mergePullRequest( r, **data ): - r._github._statusRequest( "PUT", r._baseUrl() + "/merge", None, data ) + @property + def additions( self ): + if self.__additions is None: + self.__completeIfNeeded() + return self.__additions -PullRequest = GithubObject( - "PullRequest", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/pulls/" + str( obj.number ) ), - InternalSimpleAttributes( - "id", "url", "html_url", "diff_url", "patch_url", "issue_url", "number", - "state", "title", "body", "created_at", "updated_at", "closed_at", - "merged_at", "_links", "merged", "mergeable", "comments", "commits", - "additions", "deletions", "changed_files", "head", "base", "merged_by", - "review_comments", - "_repo", - ), - InternalObjectAttribute( "user", NamedUser ), - Editable( Parameters( [], [ "title", "body", "state" ] ) ), - ExternalListOfObjects( "commits", "commit", Commit, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ), - ), - ExternalListOfObjects( "files", "file", PullRequestFile, - ListGetable( Parameters( [], [] ) ), - ), - ExternalListOfObjects( "comments", "comment", PullRequestComment, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingReferedRepo ), - ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingReferedRepo ), - ElementCreatable( Alternative( Parameters( [ "body", "commit_id", "path", "position" ], [] ), Parameters( [ "body", "in_reply_to" ], [] ) ), __modifyAttributesForObjectsReferingReferedRepo ), - ), - MethodFromCallable( "is_merged", Parameters( [], [] ), __pullRequestIsMerged, SimpleTypePolicy( "bool" ) ), - MethodFromCallable( "merge", Parameters( [], [ "commit_message" ] ), __mergePullRequest, SimpleTypePolicy( None ) ), -) + @property + def base( self ): + if self.__base is None: + self.__completeIfNeeded() + return self.__base + + @property + def body( self ): + if self.__body is None: + self.__completeIfNeeded() + return self.__body + + @property + def changed_files( self ): + if self.__changed_files is None: + self.__completeIfNeeded() + return self.__changed_files + + @property + def closed_at( self ): + if self.__closed_at is None: + self.__completeIfNeeded() + return self.__closed_at + + @property + def comments( self ): + if self.__comments is None: + self.__completeIfNeeded() + return self.__comments + + @property + def commits( self ): + if self.__commits is None: + self.__completeIfNeeded() + return self.__commits + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def deletions( self ): + if self.__deletions is None: + self.__completeIfNeeded() + return self.__deletions + + @property + def diff_url( self ): + if self.__diff_url is None: + self.__completeIfNeeded() + return self.__diff_url + + @property + def head( self ): + if self.__head is None: + self.__completeIfNeeded() + return self.__head + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def issue_url( self ): + if self.__issue_url is None: + self.__completeIfNeeded() + return self.__issue_url + + @property + def mergeable( self ): + if self.__mergeable is None: + self.__completeIfNeeded() + return self.__mergeable + + @property + def merged( self ): + if self.__merged is None: + self.__completeIfNeeded() + return self.__merged + + @property + def merged_at( self ): + if self.__merged_at is None: + self.__completeIfNeeded() + return self.__merged_at + + @property + def merged_by( self ): + if self.__merged_by is None: + self.__completeIfNeeded() + return self.__merged_by + + @property + def number( self ): + if self.__number is None: + self.__completeIfNeeded() + return self.__number + + @property + def patch_url( self ): + if self.__patch_url is None: + self.__completeIfNeeded() + return self.__patch_url + + @property + def review_comments( self ): + if self.__review_comments is None: + self.__completeIfNeeded() + return self.__review_comments + + @property + def state( self ): + if self.__state is None: + self.__completeIfNeeded() + return self.__state + + @property + def title( self ): + if self.__title is None: + self.__completeIfNeeded() + return self.__title + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + @property + def user( self ): + if self.__user is None: + self.__completeIfNeeded() + return self.__user + + def __initAttributes( self ): + self.__additions = None + self.__base = None + self.__body = None + self.__changed_files = None + self.__closed_at = None + self.__comments = None + self.__commits = None + self.__created_at = None + self.__deletions = None + self.__diff_url = None + self.__head = None + self.__html_url = None + self.__id = None + self.__issue_url = None + self.__mergeable = None + self.__merged = None + self.__merged_at = None + self.__merged_by = None + self.__number = None + self.__patch_url = None + self.__review_comments = None + self.__state = None + self.__title = None + self.__updated_at = None + self.__url = None + self.__user = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def edit( self, title = None, body = None, state = None ): + pass + + def get_comment( self, id ): + pass + + def get_comments( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/comments", + None, + None + ) + return [ + PullRequestComment.PullRequestComment( self.__github, element, lazy = True ) + for element in result + ] + + def get_commits( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/commits", + None, + None + ) + return [ + Commit.Commit( self.__github, element, lazy = True ) + for element in result + ] + + def get_files( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/files", + None, + None + ) + return [ + PullRequestFile.PullRequestFile( self.__github, element, lazy = True ) + for element in result + ] + + def is_merged( self ): + pass + + def merge( self, commit_message = None ): + pass + + def __useAttributes( self, attributes ): + if "additions" in attributes: + self.__additions = attributes[ "additions" ] + if "base" in attributes: + self.__base = attributes[ "base" ] + if "body" in attributes: + self.__body = attributes[ "body" ] + if "changed_files" in attributes: + self.__changed_files = attributes[ "changed_files" ] + if "closed_at" in attributes: + self.__closed_at = attributes[ "closed_at" ] + if "comments" in attributes: + self.__comments = attributes[ "comments" ] + if "commits" in attributes: + self.__commits = attributes[ "commits" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "deletions" in attributes: + self.__deletions = attributes[ "deletions" ] + if "diff_url" in attributes: + self.__diff_url = attributes[ "diff_url" ] + if "head" in attributes: + self.__head = attributes[ "head" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "issue_url" in attributes: + self.__issue_url = attributes[ "issue_url" ] + if "mergeable" in attributes: + self.__mergeable = attributes[ "mergeable" ] + if "merged" in attributes: + self.__merged = attributes[ "merged" ] + if "merged_at" in attributes: + self.__merged_at = attributes[ "merged_at" ] + if "merged_by" in attributes: + self.__merged_by = attributes[ "merged_by" ] + if "number" in attributes: + self.__number = attributes[ "number" ] + if "patch_url" in attributes: + self.__patch_url = attributes[ "patch_url" ] + if "review_comments" in attributes: + self.__review_comments = attributes[ "review_comments" ] + if "state" in attributes: + self.__state = attributes[ "state" ] + if "title" in attributes: + self.__title = attributes[ "title" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] + if "user" in attributes: + self.__user = attributes[ "user" ] diff --git a/github/GithubObjects/PullRequestComment.py b/github/GithubObjects/PullRequestComment.py index ac3cb0d3..3f8b5a15 100644 --- a/github/GithubObjects/PullRequestComment.py +++ b/github/GithubObjects/PullRequestComment.py @@ -1,14 +1,127 @@ -from NamedUser import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -PullRequestComment = GithubObject( - "PullRequestComment", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/pulls/comments/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "id", "body", "path", "position", "commit_id", - "created_at", "updated_at", "html_url", "line", - "_repo", - ), - InternalObjectAttribute( "user", NamedUser ), - Editable( Parameters( [ "body" ], [] ) ), - Deletable(), -) + +class PullRequestComment( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def body( self ): + if self.__body is None: + self.__completeIfNeeded() + return self.__body + + @property + def commit_id( self ): + if self.__commit_id is None: + self.__completeIfNeeded() + return self.__commit_id + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def line( self ): + if self.__line is None: + self.__completeIfNeeded() + return self.__line + + @property + def path( self ): + if self.__path is None: + self.__completeIfNeeded() + return self.__path + + @property + def position( self ): + if self.__position is None: + self.__completeIfNeeded() + return self.__position + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + @property + def user( self ): + if self.__user is None: + self.__completeIfNeeded() + return self.__user + + def __initAttributes( self ): + self.__body = None + self.__commit_id = None + self.__created_at = None + self.__html_url = None + self.__id = None + self.__line = None + self.__path = None + self.__position = None + self.__updated_at = None + self.__url = None + self.__user = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, body ): + pass + + def __useAttributes( self, attributes ): + if "body" in attributes: + self.__body = attributes[ "body" ] + if "commit_id" in attributes: + self.__commit_id = attributes[ "commit_id" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "line" in attributes: + self.__line = attributes[ "line" ] + if "path" in attributes: + self.__path = attributes[ "path" ] + if "position" in attributes: + self.__position = attributes[ "position" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] + if "user" in attributes: + self.__user = attributes[ "user" ] diff --git a/github/GithubObjects/PullRequestFile.py b/github/GithubObjects/PullRequestFile.py index d7135d16..60e3be8c 100644 --- a/github/GithubObjects/PullRequestFile.py +++ b/github/GithubObjects/PullRequestFile.py @@ -1,9 +1,103 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -PullRequestFile = GithubObject( - "PullRequestFile", - InternalSimpleAttributes( - "sha", "filename", "status", "additions", "deletions", "changes", - "blob_url", "raw_url", "patch", - ), -) + +class PullRequestFile( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def additions( self ): + if self.__additions is None: + self.__completeIfNeeded() + return self.__additions + + @property + def blob_url( self ): + if self.__blob_url is None: + self.__completeIfNeeded() + return self.__blob_url + + @property + def changes( self ): + if self.__changes is None: + self.__completeIfNeeded() + return self.__changes + + @property + def deletions( self ): + if self.__deletions is None: + self.__completeIfNeeded() + return self.__deletions + + @property + def filename( self ): + if self.__filename is None: + self.__completeIfNeeded() + return self.__filename + + @property + def patch( self ): + if self.__patch is None: + self.__completeIfNeeded() + return self.__patch + + @property + def raw_url( self ): + if self.__raw_url is None: + self.__completeIfNeeded() + return self.__raw_url + + @property + def sha( self ): + if self.__sha is None: + self.__completeIfNeeded() + return self.__sha + + @property + def status( self ): + if self.__status is None: + self.__completeIfNeeded() + return self.__status + + def __initAttributes( self ): + self.__additions = None + self.__blob_url = None + self.__changes = None + self.__deletions = None + self.__filename = None + self.__patch = None + self.__raw_url = None + self.__sha = None + self.__status = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "additions" in attributes: + self.__additions = attributes[ "additions" ] + if "blob_url" in attributes: + self.__blob_url = attributes[ "blob_url" ] + if "changes" in attributes: + self.__changes = attributes[ "changes" ] + if "deletions" in attributes: + self.__deletions = attributes[ "deletions" ] + if "filename" in attributes: + self.__filename = attributes[ "filename" ] + if "patch" in attributes: + self.__patch = attributes[ "patch" ] + if "raw_url" in attributes: + self.__raw_url = attributes[ "raw_url" ] + if "sha" in attributes: + self.__sha = attributes[ "sha" ] + if "status" in attributes: + self.__status = attributes[ "status" ] diff --git a/github/GithubObjects/Repository.py b/github/GithubObjects/Repository.py index 81ce8111..92927a93 100644 --- a/github/GithubObjects/Repository.py +++ b/github/GithubObjects/Repository.py @@ -1,144 +1,619 @@ -from NamedUser import * -from IssueEvent import * -from RepositoryKey import * -from Hook import * -from GitBlob import * -from GitCommit import * -from GitRef import * -from GitTag import * -from GitTree import * -from Label import * -from Milestone import * -from Issue import * -from Download import * -from CommitComment import * -from Commit import * -from Tag import * -from Branch import * -from PullRequest import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -__modifyAttributesForObjectsReferingRepo = { "_repo": lambda repo: repo } -__modifyAttributesForGitTree = { "_repo": lambda repo: repo, "recursive": lambda repo: False } -def __compare( repo, base, head ): - return repo._github._dataRequest( "GET", repo._baseUrl() + "/compare/" + base + "..." + head, None, None ) +class Repository( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) -Repository = GithubObject( - "Repository", - BaseUrl( lambda obj: "/repos/" + obj.owner.login + "/" + obj.name ), - Identity( lambda obj: obj.owner.login + "/" + obj.name ), - InternalSimpleAttributes( - "url", "html_url", "clone_url", "git_url", "ssh_url", "svn_url", - "name", "description", "homepage", "language", "private", - "fork", "forks", "watchers", "size", "master_branch", "open_issues", - "pushed_at", "created_at", "organization", - "has_issues", "has_wiki", "has_downloads", - # Not documented - "mirror_url", "updated_at", "id", "permissions", - ), - InternalObjectAttribute( "owner", NamedUser ), -) -Repository._addAttributePolicy( InternalObjectAttribute( "parent", Repository ) ) -Repository._addAttributePolicy( InternalObjectAttribute( "source", Repository ) ) -Repository._addAttributePolicy( - ExternalListOfObjects( "issues/events", "issues_event", IssueEvent, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ) -) -Repository._addAttributePolicy( - ExternalListOfObjects( "forks", "fork", Repository, - ListGetable( Parameters( [], [] ) ) - ) -) -Repository._addAttributePolicy( - Editable( Parameters( [ "name" ], [ "description", "homepage", "public", "has_issues", "has_wiki", "has_downloads" ] ) ) -) -Repository._addAttributePolicy( - SeveralAttributePolicies( [ ExternalSimpleAttribute( "languages", "dictionary of strings to integers" ) ], "Languages" ) -) -Repository._addAttributePolicy( SeveralAttributePolicies( [ - ExternalListOfObjects( "hooks", "hook", Hook, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "name", "config" ], [ "events", "active" ] ), __modifyAttributesForObjectsReferingRepo ), - ), - ExternalListOfObjects( "keys", "key", RepositoryKey, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "title", "key" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ), - ExternalListOfObjects( "collaborators", "collaborator", NamedUser, - ListGetable( Parameters( [], [] ) ), - ElementAddable(), - ElementRemovable(), - ElementHasable() - ), - ExternalListOfObjects( "contributors", "contributor", NamedUser, - ListGetable( Parameters( [], [] ) ) - ), - ExternalListOfObjects( "watchers", "watcher", NamedUser, - ListGetable( Parameters( [], [] ) ) - ), - ExternalListOfObjects( "git/refs", "git_ref", GitRef, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "ref" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "ref", "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ) - ), - ExternalListOfObjects( "git/commits", "git_commit", GitCommit, - ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "message", "tree", "parents" ], [ "author", "committer" ] ), __modifyAttributesForObjectsReferingRepo ) - ), - ExternalListOfObjects( "git/trees", "git_tree", GitTree, - ElementGetable( Parameters( [ "sha" ], [ "recursive" ] ), __modifyAttributesForGitTree ), - ElementCreatable( Parameters( [ "tree" ], [ "base_tree" ] ), __modifyAttributesForGitTree ) - ), - ExternalListOfObjects( "git/blobs", "git_blob", GitBlob, - ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "content", "encoding" ], [] ), __modifyAttributesForObjectsReferingRepo ) - ), - ExternalListOfObjects( "git/tags", "git_tag", GitTag, - ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "tag", "message", "object", "type" ], [ "tagger" ] ), __modifyAttributesForObjectsReferingRepo ) - ), - ExternalListOfObjects( "labels", "label", Label, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "name" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "name", "color" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ), - ExternalListOfObjects( "milestones", "milestone", Milestone, - ListGetable( Parameters( [], [ "state", "sort", "direction" ] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "number" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "title" ], [ "state", "description", "due_on" ] ), __modifyAttributesForObjectsReferingRepo ) - ), - ExternalListOfObjects( "issues", "issue", Issue, - ListGetable( Parameters( [], [ "milestone", "state", "assignee", "mentioned", "labels", "sort", "direction", "since" ] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "number" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "title" ], [ "body", "assignee", "milestone", "labels", ] ), __modifyAttributesForObjectsReferingRepo ) - ), - ExternalListOfObjects( "downloads", "download", Download, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Parameters( [ "name", "size" ], [ "description", "content_type" ] ), __modifyAttributesForObjectsReferingRepo ), - ), - ExternalListOfObjects( "comments", "comment", CommitComment, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "id" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ), - ExternalListOfObjects( "commits", "commit", Commit, - ListGetable( Parameters( [], [ "sha", "path" ] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "sha" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ), - ExternalListOfObjects( "tags", "tag", Tag, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ), - ExternalListOfObjects( "branches", "branch", Branch, - ListGetable( Parameters( [], [] ), __modifyAttributesForObjectsReferingRepo ), - ), - ExternalListOfObjects( "pulls", "pull", PullRequest, - ListGetable( Parameters( [], [ "state" ] ), __modifyAttributesForObjectsReferingRepo ), - ElementGetable( Parameters( [ "number" ], [] ), __modifyAttributesForObjectsReferingRepo ), - ElementCreatable( Alternative( Parameters( [ "title", "body", "base", "head" ], [] ), Parameters( [ "issue", "base", "head" ], [] ) ), __modifyAttributesForObjectsReferingRepo ), - ), - MethodFromCallable( "compare", Parameters( [ "base", "head" ], [] ), __compare, SimpleTypePolicy( None ) ), -] ) ) + @property + def clone_url( self ): + if self.__clone_url is None: + self.__completeIfNeeded() + return self.__clone_url + + @property + def created_at( self ): + if self.__created_at is None: + self.__completeIfNeeded() + return self.__created_at + + @property + def description( self ): + if self.__description is None: + self.__completeIfNeeded() + return self.__description + + @property + def fork( self ): + if self.__fork is None: + self.__completeIfNeeded() + return self.__fork + + @property + def forks( self ): + if self.__forks is None: + self.__completeIfNeeded() + return self.__forks + + @property + def git_url( self ): + if self.__git_url is None: + self.__completeIfNeeded() + return self.__git_url + + @property + def has_downloads( self ): + if self.__has_downloads is None: + self.__completeIfNeeded() + return self.__has_downloads + + @property + def has_issues( self ): + if self.__has_issues is None: + self.__completeIfNeeded() + return self.__has_issues + + @property + def has_wiki( self ): + if self.__has_wiki is None: + self.__completeIfNeeded() + return self.__has_wiki + + @property + def homepage( self ): + if self.__homepage is None: + self.__completeIfNeeded() + return self.__homepage + + @property + def html_url( self ): + if self.__html_url is None: + self.__completeIfNeeded() + return self.__html_url + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def language( self ): + if self.__language is None: + self.__completeIfNeeded() + return self.__language + + @property + def master_branch( self ): + if self.__master_branch is None: + self.__completeIfNeeded() + return self.__master_branch + + @property + def mirror_url( self ): + if self.__mirror_url is None: + self.__completeIfNeeded() + return self.__mirror_url + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def open_issues( self ): + if self.__open_issues is None: + self.__completeIfNeeded() + return self.__open_issues + + @property + def organization( self ): + if self.__organization is None: + self.__completeIfNeeded() + return self.__organization + + @property + def owner( self ): + if self.__owner is None: + self.__completeIfNeeded() + return self.__owner + + @property + def parent( self ): + if self.__parent is None: + self.__completeIfNeeded() + return self.__parent + + @property + def permissions( self ): + if self.__permissions is None: + self.__completeIfNeeded() + return self.__permissions + + @property + def private( self ): + if self.__private is None: + self.__completeIfNeeded() + return self.__private + + @property + def pushed_at( self ): + if self.__pushed_at is None: + self.__completeIfNeeded() + return self.__pushed_at + + @property + def size( self ): + if self.__size is None: + self.__completeIfNeeded() + return self.__size + + @property + def source( self ): + if self.__source is None: + self.__completeIfNeeded() + return self.__source + + @property + def ssh_url( self ): + if self.__ssh_url is None: + self.__completeIfNeeded() + return self.__ssh_url + + @property + def svn_url( self ): + if self.__svn_url is None: + self.__completeIfNeeded() + return self.__svn_url + + @property + def updated_at( self ): + if self.__updated_at is None: + self.__completeIfNeeded() + return self.__updated_at + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + @property + def watchers( self ): + if self.__watchers is None: + self.__completeIfNeeded() + return self.__watchers + + def __initAttributes( self ): + self.__clone_url = None + self.__created_at = None + self.__description = None + self.__fork = None + self.__forks = None + self.__git_url = None + self.__has_downloads = None + self.__has_issues = None + self.__has_wiki = None + self.__homepage = None + self.__html_url = None + self.__id = None + self.__language = None + self.__master_branch = None + self.__mirror_url = None + self.__name = None + self.__open_issues = None + self.__organization = None + self.__owner = None + self.__parent = None + self.__permissions = None + self.__private = None + self.__pushed_at = None + self.__size = None + self.__source = None + self.__ssh_url = None + self.__svn_url = None + self.__updated_at = None + self.__url = None + self.__watchers = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def add_to_collaborators( self, collaborator ): + pass + + def compare( self, base, head ): + pass + + def create_download( self, name, size, description = None, content_type = None ): + pass + + def create_git_blob( self, content, encoding ): + pass + + def create_git_commit( self, message, tree, parents, author = None, committer = None ): + pass + + def create_git_ref( self, ref, sha ): + pass + + def create_git_tag( self, tag, message, object, type, tagger = None ): + pass + + def create_git_tree( self, tree, base_tree = None ): + pass + + def create_hook( self, name, config, events = None, active = None ): + pass + + def create_issue( self, title, body = None, assignee = None, milestone = None, labels = None ): + pass + + def create_key( self, title, key ): + pass + + def create_label( self, name, color ): + pass + + def create_milestone( self, title, state = None, description = None, due_on = None ): + pass + + def edit( self, name, description = None, homepage = None, public = None, has_issues = None, has_wiki = None, has_downloads = None ): + pass + + def get_branches( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/branches", + None, + None + ) + return [ + Branch.Branch( self.__github, element, lazy = True ) + for element in result + ] + + def get_collaborators( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/collaborators", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_comment( self, id ): + pass + + def get_comments( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/comments", + None, + None + ) + return [ + CommitComment.CommitComment( self.__github, element, lazy = True ) + for element in result + ] + + def get_commit( self, sha ): + pass + + def get_commits( self, sha = None, path = None ): + result = self.__github._dataRequest( + "GET", + self.url + "/commits", + None, + None + ) + return [ + Commit.Commit( self.__github, element, lazy = True ) + for element in result + ] + + def get_contributors( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/contributors", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_download( self, id ): + pass + + def get_downloads( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/downloads", + None, + None + ) + return [ + Download.Download( self.__github, element, lazy = True ) + for element in result + ] + + def get_events( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/events", + None, + None + ) + return [ + Event.Event( self.__github, element, lazy = True ) + for element in result + ] + + def get_forks( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/forks", + None, + None + ) + return [ + Repository.Repository( self.__github, element, lazy = True ) + for element in result + ] + + def get_git_blob( self, sha ): + pass + + def get_git_commit( self, sha ): + pass + + def get_git_ref( self, ref ): + pass + + def get_git_refs( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/git_refs", + None, + None + ) + return [ + GitRef.GitRef( self.__github, element, lazy = True ) + for element in result + ] + + def get_git_tag( self, sha ): + pass + + def get_git_tree( self, sha, recursive = None ): + pass + + def get_hook( self, id ): + pass + + def get_hooks( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/hooks", + None, + None + ) + return [ + Hook.Hook( self.__github, element, lazy = True ) + for element in result + ] + + def get_issue( self, number ): + pass + + def get_issues( self, milestone = None, state = None, assignee = None, mentioned = None, labels = None, sort = None, direction = None, since = None ): + result = self.__github._dataRequest( + "GET", + self.url + "/issues", + None, + None + ) + return [ + Issue.Issue( self.__github, element, lazy = True ) + for element in result + ] + + def get_issues_event( self, id ): + pass + + def get_issues_events( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/issues_events", + None, + None + ) + return [ + IssueEvent.IssueEvent( self.__github, element, lazy = True ) + for element in result + ] + + def get_key( self, id ): + pass + + def get_keys( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/keys", + None, + None + ) + return [ + RepositoryKey.RepositoryKey( self.__github, element, lazy = True ) + for element in result + ] + + def get_label( self, name ): + pass + + def get_labels( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/labels", + None, + None + ) + return [ + Label.Label( self.__github, element, lazy = True ) + for element in result + ] + + def get_languages( self ): + pass + + def get_milestone( self, number ): + pass + + def get_milestones( self, state = None, sort = None, direction = None ): + result = self.__github._dataRequest( + "GET", + self.url + "/milestones", + None, + None + ) + return [ + Milestone.Milestone( self.__github, element, lazy = True ) + for element in result + ] + + def get_network_events( self ): + pass + + def get_pull( self, number ): + pass + + def get_pulls( self, state = None ): + result = self.__github._dataRequest( + "GET", + self.url + "/pulls", + None, + None + ) + return [ + PullRequest.PullRequest( self.__github, element, lazy = True ) + for element in result + ] + + def get_tags( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/tags", + None, + None + ) + return [ + Tag.Tag( self.__github, element, lazy = True ) + for element in result + ] + + def get_teams( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/teams", + None, + None + ) + return [ + Team.Team( self.__github, element, lazy = True ) + for element in result + ] + + def get_watchers( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/watchers", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def has_in_collaborators( self, collaborator ): + pass + + def remove_from_collaborators( self, collaborator ): + pass + + def __useAttributes( self, attributes ): + if "clone_url" in attributes: + self.__clone_url = attributes[ "clone_url" ] + if "created_at" in attributes: + self.__created_at = attributes[ "created_at" ] + if "description" in attributes: + self.__description = attributes[ "description" ] + if "fork" in attributes: + self.__fork = attributes[ "fork" ] + if "forks" in attributes: + self.__forks = attributes[ "forks" ] + if "git_url" in attributes: + self.__git_url = attributes[ "git_url" ] + if "has_downloads" in attributes: + self.__has_downloads = attributes[ "has_downloads" ] + if "has_issues" in attributes: + self.__has_issues = attributes[ "has_issues" ] + if "has_wiki" in attributes: + self.__has_wiki = attributes[ "has_wiki" ] + if "homepage" in attributes: + self.__homepage = attributes[ "homepage" ] + if "html_url" in attributes: + self.__html_url = attributes[ "html_url" ] + if "id" in attributes: + self.__id = attributes[ "id" ] + if "language" in attributes: + self.__language = attributes[ "language" ] + if "master_branch" in attributes: + self.__master_branch = attributes[ "master_branch" ] + if "mirror_url" in attributes: + self.__mirror_url = attributes[ "mirror_url" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "open_issues" in attributes: + self.__open_issues = attributes[ "open_issues" ] + if "organization" in attributes: + self.__organization = attributes[ "organization" ] + if "owner" in attributes: + self.__owner = attributes[ "owner" ] + if "parent" in attributes: + self.__parent = attributes[ "parent" ] + if "permissions" in attributes: + self.__permissions = attributes[ "permissions" ] + if "private" in attributes: + self.__private = attributes[ "private" ] + if "pushed_at" in attributes: + self.__pushed_at = attributes[ "pushed_at" ] + if "size" in attributes: + self.__size = attributes[ "size" ] + if "source" in attributes: + self.__source = attributes[ "source" ] + if "ssh_url" in attributes: + self.__ssh_url = attributes[ "ssh_url" ] + if "svn_url" in attributes: + self.__svn_url = attributes[ "svn_url" ] + if "updated_at" in attributes: + self.__updated_at = attributes[ "updated_at" ] + if "url" in attributes: + self.__url = attributes[ "url" ] + if "watchers" in attributes: + self.__watchers = attributes[ "watchers" ] diff --git a/github/GithubObjects/RepositoryKey.py b/github/GithubObjects/RepositoryKey.py index cea71c01..f8e8c67f 100644 --- a/github/GithubObjects/RepositoryKey.py +++ b/github/GithubObjects/RepositoryKey.py @@ -1,12 +1,64 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -RepositoryKey = GithubObject( - "RepositoryKey", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/keys/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "id", "title", "key", - "_repo", - ), - Editable( Parameters( [ "title", "key" ], [] ) ), - Deletable() -) + +class RepositoryKey( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def key( self ): + if self.__key is None: + self.__completeIfNeeded() + return self.__key + + @property + def title( self ): + if self.__title is None: + self.__completeIfNeeded() + return self.__title + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__id = None + self.__key = None + self.__title = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, title, key ): + pass + + def __useAttributes( self, attributes ): + if "id" in attributes: + self.__id = attributes[ "id" ] + if "key" in attributes: + self.__key = attributes[ "key" ] + if "title" in attributes: + self.__title = attributes[ "title" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/Repository_complete.py b/github/GithubObjects/Repository_complete.py deleted file mode 100644 index 4a9ae6f5..00000000 --- a/github/GithubObjects/Repository_complete.py +++ /dev/null @@ -1,27 +0,0 @@ -from Repository import * - -from Team import * -from Event import * - -Repository._addAttributePolicy( - ExternalListOfObjects( "teams", "team", Team, - ListGetable( Parameters( [], [] ) ) - ) -) - -Repository._addAttributePolicy( - ExternalListOfObjects( "events", "event", Event, - ListGetable( Parameters( [], [] ) ) - ), -) - -def __getNetworkEvents( repo ): - return [ - Event( repo._github, attributes, lazy = True ) - for attributes - in repo._github._dataRequest( "GET", "/networks/" + repo.owner.login + "/" + repo.name + "/events", None, None ) - ] - -Repository._addAttributePolicy( - MethodFromCallable( "get_network_events", Parameters( [], [] ), __getNetworkEvents, SimpleTypePolicy( "list of `Event`" ) ) -) diff --git a/github/GithubObjects/Tag.py b/github/GithubObjects/Tag.py index cd65493d..da600966 100644 --- a/github/GithubObjects/Tag.py +++ b/github/GithubObjects/Tag.py @@ -1,10 +1,58 @@ -from Commit import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -Tag = GithubObject( - "Tag", - InternalSimpleAttributes( - "name", "zipball_url", "tarball_url", - "_repo", - ), - InternalObjectAttribute( "commit", Commit ) -) + +class Tag( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def commit( self ): + if self.__commit is None: + self.__completeIfNeeded() + return self.__commit + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def tarball_url( self ): + if self.__tarball_url is None: + self.__completeIfNeeded() + return self.__tarball_url + + @property + def zipball_url( self ): + if self.__zipball_url is None: + self.__completeIfNeeded() + return self.__zipball_url + + def __initAttributes( self ): + self.__commit = None + self.__name = None + self.__tarball_url = None + self.__zipball_url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def __useAttributes( self, attributes ): + if "commit" in attributes: + self.__commit = attributes[ "commit" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "tarball_url" in attributes: + self.__tarball_url = attributes[ "tarball_url" ] + if "zipball_url" in attributes: + self.__zipball_url = attributes[ "zipball_url" ] diff --git a/github/GithubObjects/Team.py b/github/GithubObjects/Team.py index fcd84420..e6d2c076 100644 --- a/github/GithubObjects/Team.py +++ b/github/GithubObjects/Team.py @@ -1,25 +1,124 @@ -from NamedUser import * -from Repository import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -Team = GithubObject( - "Team", - BaseUrl( lambda obj: "/teams/" + str( obj.id ) ), - Identity( lambda obj: str( obj.id ) ), - InternalSimpleAttributes( - "url", "name", "id", "permission", "members_count", "repos_count", - ), - Editable( Parameters( [ "name" ], [ "permission" ] ) ), - Deletable(), - ExternalListOfObjects( "members", "member", NamedUser, - ListGetable( Parameters( [], [] ) ), - ElementAddable(), - ElementRemovable(), - ElementHasable() - ), - ExternalListOfObjects( "repos", "repo", Repository, - ListGetable( Parameters( [], [] ) ), - ElementAddable(), - ElementRemovable(), - ElementHasable() - ), -) + +class Team( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def members_count( self ): + if self.__members_count is None: + self.__completeIfNeeded() + return self.__members_count + + @property + def name( self ): + if self.__name is None: + self.__completeIfNeeded() + return self.__name + + @property + def permission( self ): + if self.__permission is None: + self.__completeIfNeeded() + return self.__permission + + @property + def repos_count( self ): + if self.__repos_count is None: + self.__completeIfNeeded() + return self.__repos_count + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__id = None + self.__members_count = None + self.__name = None + self.__permission = None + self.__repos_count = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def add_to_members( self, member ): + pass + + def add_to_repos( self, repo ): + pass + + def delete( self ): + pass + + def edit( self, name, permission = None ): + pass + + def get_members( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/members", + None, + None + ) + return [ + NamedUser.NamedUser( self.__github, element, lazy = True ) + for element in result + ] + + def get_repos( self ): + result = self.__github._dataRequest( + "GET", + self.url + "/repos", + None, + None + ) + return [ + Repository.Repository( self.__github, element, lazy = True ) + for element in result + ] + + def has_in_members( self, member ): + pass + + def has_in_repos( self, repo ): + pass + + def remove_from_members( self, member ): + pass + + def remove_from_repos( self, repo ): + pass + + def __useAttributes( self, attributes ): + if "id" in attributes: + self.__id = attributes[ "id" ] + if "members_count" in attributes: + self.__members_count = attributes[ "members_count" ] + if "name" in attributes: + self.__name = attributes[ "name" ] + if "permission" in attributes: + self.__permission = attributes[ "permission" ] + if "repos_count" in attributes: + self.__repos_count = attributes[ "repos_count" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/UserKey.py b/github/GithubObjects/UserKey.py index ba912f6a..87557b8b 100644 --- a/github/GithubObjects/UserKey.py +++ b/github/GithubObjects/UserKey.py @@ -1,11 +1,64 @@ -from GithubObject import * +# WARNING: this file is generated automaticaly. +# Do not modify it manually, your work would be lost. -UserKey = GithubObject( - "UserKey", - BaseUrl( lambda obj: "/user/keys/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "id", "title", "key", - ), - Editable( Parameters( [], [ "title", "key" ] ) ), - Deletable(), -) + +class UserKey( object ): + def __init__( self, github, attributes, lazy ): + self.__github = github + self.__completed = False + self.__initAttributes() + self.__useAttributes( attributes ) + + @property + def id( self ): + if self.__id is None: + self.__completeIfNeeded() + return self.__id + + @property + def key( self ): + if self.__key is None: + self.__completeIfNeeded() + return self.__key + + @property + def title( self ): + if self.__title is None: + self.__completeIfNeeded() + return self.__title + + @property + def url( self ): + if self.__url is None: + self.__completeIfNeeded() + return self.__url + + def __initAttributes( self ): + self.__id = None + self.__key = None + self.__title = None + self.__url = None + + def __completeIfNeeded( self ): + if not self.__completed: + self.__complete() + self.__completed = True + + def __complete( self ): + pass + + def delete( self ): + pass + + def edit( self, title = None, key = None ): + pass + + def __useAttributes( self, attributes ): + if "id" in attributes: + self.__id = attributes[ "id" ] + if "key" in attributes: + self.__key = attributes[ "key" ] + if "title" in attributes: + self.__title = attributes[ "title" ] + if "url" in attributes: + self.__url = attributes[ "url" ] diff --git a/github/GithubObjects/__init__.py b/github/GithubObjects/__init__.py index e19884f3..e69de29b 100644 --- a/github/GithubObjects/__init__.py +++ b/github/GithubObjects/__init__.py @@ -1,13 +0,0 @@ -from AuthenticatedUser import * - -# This strange import pattern works around cyclic dependencies -from NamedUser import * -from NamedUser_complete import * - -from Organization import * -from Organization_complete import * - -from Repository import * -from Repository_complete import * - -from Gist import * diff --git a/github/Requester.py b/github/Requester.py index fac044b8..7ce1c591 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -45,6 +45,8 @@ class Requester: def __rawRequest( self, verb, url, parameters, input ): assert verb in [ "HEAD", "GET", "POST", "PATCH", "PUT", "DELETE" ] + assert url.startswith( "https://api.github.com" ) + url = url[ len( "https://api.github.com" ) : ] cnx = httplib.HTTPSConnection( "api.github.com", strict = True ) cnx.request(