From 821ac669f212b1e8868567517f8b85f8a7eb04cf Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 27 May 2012 20:46:29 +0100 Subject: [PATCH] Set types of many parameters --- .../description.000.human_readable.json | 134 ++++++++-------- .../description.001.normalized.json | 150 +++++++++--------- doc/ReferenceOfClasses.md | 134 ++++++++-------- src/github/AuthenticatedUser.py | 12 ++ src/github/Authorization.py | 10 ++ src/github/Commit.py | 7 + src/github/CommitComment.py | 1 + src/github/Gist.py | 2 + src/github/GistComment.py | 1 + src/github/GitRef.py | 3 + src/github/Hook.py | 9 ++ src/github/Issue.py | 13 ++ src/github/IssueComment.py | 1 + src/github/Label.py | 2 + src/github/Milestone.py | 7 + src/github/NamedUser.py | 2 + src/github/Organization.py | 18 +++ src/github/PullRequest.py | 11 ++ src/github/PullRequestComment.py | 1 + src/github/Team.py | 3 + src/github/UserKey.py | 4 + 21 files changed, 316 insertions(+), 209 deletions(-) diff --git a/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json b/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json index 608c5370..3794441f 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json +++ b/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json @@ -63,13 +63,13 @@ ], "createElement": { "optionalParameters": [ - { "name": "scopes", "type": "@todo" }, - { "name": "note", "type": "@todo" }, - { "name": "note_url", "type": "@todo" } + { "name": "scopes", "type": "list:string" }, + { "name": "note", "type": "string" }, + { "name": "note_url", "type": "string" } ] }, "getElement": { - "parameter": { "name": "id", "type": "@todo" } + "parameter": { "name": "id", "type": "integer" } }, "getList": true }, @@ -94,12 +94,12 @@ "url": [ { "type": "constant", "value": "https://api.github.com/user/keys" } ], "getList": true, "getElement": { - "parameter": { "name": "id", "type": "@todo" } + "parameter": { "name": "id", "type": "integer" } }, "createElement": { "mandatoryParameters": [ - { "name": "title", "type": "@todo" }, - { "name": "key", "type": "@todo" } + { "name": "title", "type": "string" }, + { "name": "key", "type": "string" } ] } }, @@ -109,7 +109,7 @@ "type": "Repository", "getList": { "optionalParameters": [ - { "name": "type", "type": "@todo" } + { "name": "type", "type": "string" } ] }, "getElement": { @@ -249,11 +249,11 @@ "isCompletable": true, "edit": { "optionalParameters": [ - { "name": "scopes", "type": "@todo" }, - { "name": "add_scopes", "type": "@todo" }, - { "name": "remove_scopes", "type": "@todo" }, - { "name": "note", "type": "@todo" }, - { "name": "note_url", "type": "@todo" } + { "name": "scopes", "type": "list:string" }, + { "name": "add_scopes", "type": "list:string" }, + { "name": "remove_scopes", "type": "list:string" }, + { "name": "note", "type": "string" }, + { "name": "note_url", "type": "string" } ] }, "delete": true, @@ -319,12 +319,12 @@ "getList": true, "createElement": { "mandatoryParameters": [ - { "name": "body", "type": "@todo" } + { "name": "body", "type": "string" } ], "optionalParameters": [ - { "name": "line", "type": "@todo" }, - { "name": "path", "type": "@todo" }, - { "name": "position", "type": "@todo" } + { "name": "line", "type": "integer" }, + { "name": "path", "type": "string" }, + { "name": "position", "type": "integer" } ] } } @@ -335,7 +335,7 @@ "isCompletable": true, "edit": { "mandatoryParameters": [ - { "name": "body", "type": "@todo" } + { "name": "body", "type": "string" } ] }, "delete": true, @@ -437,7 +437,7 @@ "type": "GistComment", "getList": true, "getElement": { - "parameter": { "name": "id", "type": "@todo" }, + "parameter": { "name": "id", "type": "integer" }, "url": [ { "type": "constant", "value": "https://api.github.com/gists/comments/" }, { "type": "argument", "value": [ "id" ] } @@ -445,7 +445,7 @@ }, "createElement": { "mandatoryParameters": [ - { "name": "body", "type": "@todo" } + { "name": "body", "type": "string" } ] } } @@ -509,7 +509,7 @@ "name": "GistComment", "edit": { "mandatoryParameters": [ - { "name": "body", "type": "@todo" } + { "name": "body", "type": "string" } ] }, "delete": true, @@ -556,10 +556,10 @@ "name": "GitRef", "edit": { "mandatoryParameters": [ - { "name": "sha", "type": "@todo" } + { "name": "sha", "type": "string" } ], "optionalParameters": [ - { "name": "force", "type": "@todo" } + { "name": "force", "type": "bool" } ] }, "delete": true, @@ -611,14 +611,14 @@ "name": "Hook", "edit": { "mandatoryParameters": [ - { "name": "name", "type": "@todo" }, + { "name": "name", "type": "string" }, { "name": "config", "type": "@todo" } ], "optionalParameters": [ - { "name": "events", "type": "@todo" }, - { "name": "add_events", "type": "@todo" }, - { "name": "remove_events", "type": "@todo" }, - { "name": "active", "type": "@todo" } + { "name": "events", "type": "list:string" }, + { "name": "add_events", "type": "list:string" }, + { "name": "remove_events", "type": "list:string" }, + { "name": "active", "type": "bool" } ] }, "delete": true, @@ -654,12 +654,12 @@ "isCompletable": true, "edit": { "optionalParameters": [ - { "name": "title", "type": "@todo" }, - { "name": "body", "type": "@todo" }, - { "name": "assignee", "type": "@todo" }, - { "name": "state", "type": "@todo" }, - { "name": "milestone", "type": "@todo" }, - { "name": "labels", "type": "@todo" } + { "name": "title", "type": "string" }, + { "name": "body", "type": "string" }, + { "name": "assignee", "type": "string" }, + { "name": "state", "type": "string" }, + { "name": "milestone", "type": "integer" }, + { "name": "labels", "type": "list:string" } ] }, "attributes": [ @@ -689,7 +689,7 @@ "type": "IssueComment", "getList": true, "getElement": { - "parameter": { "name": "id", "type": "@todo" }, + "parameter": { "name": "id", "type": "integer" }, "request": { "url": [ { @@ -732,7 +732,7 @@ "name": "IssueComment", "edit": { "mandatoryParameters": [ - { "name": "body", "type": "@todo" } + { "name": "body", "type": "string" } ] }, "delete": true, @@ -762,8 +762,8 @@ "name": "Label", "edit": { "mandatoryParameters": [ - { "name": "name", "type": "@todo" }, - { "name": "color", "type": "@todo" } + { "name": "name", "type": "string" }, + { "name": "color", "type": "string" } ] }, "delete": true, @@ -785,12 +785,12 @@ "name": "Milestone", "edit": { "mandatoryParameters": [ - { "name": "title", "type": "@todo" } + { "name": "title", "type": "string" } ], "optionalParameters": [ - { "name": "state", "type": "@todo" }, - { "name": "description", "type": "@todo" }, - { "name": "due_on", "type": "@todo" } + { "name": "state", "type": "string" }, + { "name": "description", "type": "string" }, + { "name": "due_on", "type": "string" } ] }, "delete": true, @@ -873,7 +873,7 @@ "type": "Repository", "getList": { "optionalParameters": [ - { "name": "type", "type": "@todo" } + { "name": "type", "type": "string" } ] }, "getElement": { @@ -958,12 +958,12 @@ "isCompletable": true, "edit": { "optionalParameters": [ - { "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" } + { "name": "billing_email", "type": "string" }, + { "name": "blog", "type": "string" }, + { "name": "company", "type": "string" }, + { "name": "email", "type": "string" }, + { "name": "location", "type": "string" }, + { "name": "name", "type": "string" } ] }, "attributes": [ @@ -1022,7 +1022,7 @@ "type": "Repository", "getList": { "optionalParameters": [ - { "name": "type", "type": "@todo" } + { "name": "type", "type": "string" } ] }, "getElement": { @@ -1045,7 +1045,7 @@ { "name": "has_issues", "type": "bool" }, { "name": "has_wiki", "type": "bool" }, { "name": "has_downloads", "type": "bool" }, - { "name": "team_id", "type": "@todo" } + { "name": "team_id", "type": "integer" } ] } }, @@ -1060,7 +1060,7 @@ ], "optionalParameters": [ { "name": "repo_names", "type": "list:string" }, - { "name": "permission", "type": "@todo" } + { "name": "permission", "type": "string" } ] }, "getElement": { @@ -1100,9 +1100,9 @@ "isCompletable": true, "edit": { "optionalParameters": [ - { "name": "title", "type": "@todo" }, - { "name": "body", "type": "@todo" }, - { "name": "state", "type": "@todo" } + { "name": "title", "type": "string" }, + { "name": "body", "type": "string" }, + { "name": "state", "type": "string" } ] }, "attributes": [ @@ -1140,7 +1140,7 @@ "type": "PullRequestComment", "getList": true, "getElement": { - "parameter": { "name": "id", "type": "@todo" }, + "parameter": { "name": "id", "type": "integer" }, "request": { "url": [ { @@ -1157,10 +1157,10 @@ }, "createElement": { "mandatoryParameters": [ - { "name": "body", "type": "@todo" }, - { "name": "commit_id", "type": "@todo" }, - { "name": "path", "type": "@todo" }, - { "name": "position", "type": "@todo" } + { "name": "body", "type": "string" }, + { "name": "commit_id", "type": "string" }, + { "name": "path", "type": "string" }, + { "name": "position", "type": "integer" } ] } }, @@ -1215,7 +1215,7 @@ "isCompletable": true, "edit": { "mandatoryParameters": [ - { "name": "body", "type": "@todo" } + { "name": "body", "type": "string" } ] }, "delete": true, @@ -1701,8 +1701,8 @@ "type": "@todo", "group": "Comparison", "mandatoryParameters": [ - { "name": "base", "type": "@todo" }, - { "name": "head", "type": "@todo" } + { "name": "base", "type": "string" }, + { "name": "head", "type": "string" } ], "request": { "verb": "GET", @@ -1749,10 +1749,10 @@ "isCompletable": true, "edit": { "mandatoryParameters": [ - { "name": "name", "type": "@todo" } + { "name": "name", "type": "string" } ], "optionalParameters": [ - { "name": "permission", "type": "@todo" } + { "name": "permission", "type": "string" } ] }, "delete": true, @@ -1790,8 +1790,8 @@ "isCompletable": true, "edit": { "optionalParameters": [ - { "name": "title", "type": "@todo" }, - { "name": "key", "type": "@todo" } + { "name": "title", "type": "string" }, + { "name": "key", "type": "string" } ] }, "delete": true, diff --git a/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json b/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json index 33811ddf..afcd2fb9 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json +++ b/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json @@ -311,8 +311,8 @@ { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "scopes" }, @@ -320,7 +320,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "note" }, @@ -328,7 +328,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "note_url" } @@ -350,7 +350,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" } @@ -469,7 +469,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "title" }, @@ -477,7 +477,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "key" } @@ -512,7 +512,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" } @@ -735,7 +735,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "type" } @@ -1585,24 +1585,24 @@ { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "scopes" }, { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "add_scopes" }, { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "remove_scopes" }, @@ -1610,7 +1610,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "note" }, @@ -1618,7 +1618,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "note_url" } @@ -1761,7 +1761,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" } @@ -1789,7 +1789,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "line" }, @@ -1797,7 +1797,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "path" }, @@ -1805,7 +1805,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "position" } @@ -1953,7 +1953,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" } @@ -2589,7 +2589,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" } @@ -2630,7 +2630,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" } @@ -2880,7 +2880,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" } @@ -3193,7 +3193,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "sha" } @@ -3217,7 +3217,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "bool" }, "name": "force" } @@ -3485,7 +3485,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "name" }, @@ -3516,24 +3516,24 @@ { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "events" }, { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "add_events" }, { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "remove_events" }, @@ -3541,7 +3541,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "bool" }, "name": "active" } @@ -3785,7 +3785,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "title" }, @@ -3793,7 +3793,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" }, @@ -3801,7 +3801,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "assignee" }, @@ -3809,7 +3809,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "state" }, @@ -3817,15 +3817,15 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "milestone" }, { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "labels" } @@ -3888,7 +3888,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" } @@ -4255,7 +4255,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" } @@ -4425,7 +4425,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "name" }, @@ -4433,7 +4433,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "color" } @@ -4591,7 +4591,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "title" } @@ -4615,7 +4615,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "state" }, @@ -4623,7 +4623,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "description" }, @@ -4631,7 +4631,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "due_on" } @@ -5095,7 +5095,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "type" } @@ -5576,7 +5576,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "billing_email" }, @@ -5584,7 +5584,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "blog" }, @@ -5592,7 +5592,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "company" }, @@ -5600,7 +5600,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "email" }, @@ -5608,7 +5608,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "location" }, @@ -5616,7 +5616,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "name" } @@ -6067,7 +6067,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "team_id" } @@ -6157,7 +6157,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "type" } @@ -6215,7 +6215,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "permission" } @@ -6671,7 +6671,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "title" }, @@ -6679,7 +6679,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" }, @@ -6687,7 +6687,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "state" } @@ -6709,7 +6709,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" }, @@ -6717,7 +6717,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "commit_id" }, @@ -6725,7 +6725,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "path" }, @@ -6733,7 +6733,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "position" } @@ -6774,7 +6774,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" } @@ -7088,7 +7088,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" } @@ -10013,7 +10013,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "base" }, @@ -10021,7 +10021,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "head" } @@ -10288,7 +10288,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "name" } @@ -10312,7 +10312,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "permission" } @@ -10796,7 +10796,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "title" }, @@ -10804,7 +10804,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "key" } diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index deae6fb7..572c3284 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -44,11 +44,11 @@ Attributes Authorizations -------------- * `create_authorization( [scopes, note, note_url] )`: `Authorization` - * `scopes` - * `note` - * `note_url` + * `scopes`: list of string + * `note`: string + * `note_url`: string * `get_authorization( id )`: `Authorization` - * `id` + * `id`: integer * `get_authorizations()`: list of `Authorization` Emails @@ -100,10 +100,10 @@ Issues Keys ---- * `create_key( title, key )`: `UserKey` - * `title` - * `key` + * `title`: string + * `key`: string * `get_key( id )`: `UserKey` - * `id` + * `id`: integer * `get_keys()`: list of `UserKey` Modification @@ -134,7 +134,7 @@ Repos * `get_repo( name )`: `Repository` * `name`: string * `get_repos( [type] )`: list of `Repository` - * `type` + * `type`: string Watched ------- @@ -168,11 +168,11 @@ Deletion Modification ------------ * `edit( [scopes, add_scopes, remove_scopes, note, note_url] )` - * `scopes` - * `add_scopes` - * `remove_scopes` - * `note` - * `note_url` + * `scopes`: list of string + * `add_scopes`: list of string + * `remove_scopes`: list of string + * `note`: string + * `note_url`: string Class `Branch` ============== @@ -199,10 +199,10 @@ Attributes Comments -------- * `create_comment( body, [line, path, position] )`: `CommitComment` - * `body` - * `line` - * `path` - * `position` + * `body`: string + * `line`: integer + * `path`: string + * `position`: integer * `get_comments()`: list of `CommitComment` Class `CommitComment` @@ -229,7 +229,7 @@ Deletion Modification ------------ * `edit( body )` - * `body` + * `body`: string Class `CommitFile` ================== @@ -323,9 +323,9 @@ Attributes Comments -------- * `create_comment( body )`: `GistComment` - * `body` + * `body`: string * `get_comment( id )`: `GistComment` - * `id` + * `id`: integer * `get_comments()`: list of `GistComment` Deletion @@ -367,7 +367,7 @@ Deletion Modification ------------ * `edit( body )` - * `body` + * `body`: string Class `GistHistoryState` ======================== @@ -438,8 +438,8 @@ Deletion Modification ------------ * `edit( sha, [force] )` - * `sha` - * `force` + * `sha`: string + * `force`: bool Class `GitTag` ============== @@ -496,12 +496,12 @@ Deletion Modification ------------ * `edit( name, config, [events, add_events, remove_events, active] )` - * `name` + * `name`: string * `config` - * `events` - * `add_events` - * `remove_events` - * `active` + * `events`: list of string + * `add_events`: list of string + * `remove_events`: list of string + * `active`: bool Testing ------- @@ -536,7 +536,7 @@ Comments * `create_comment( body )`: `IssueComment` * `body`: string * `get_comment( id )`: `IssueComment` - * `id` + * `id`: integer * `get_comments()`: list of `IssueComment` Events @@ -557,12 +557,12 @@ Labels Modification ------------ * `edit( [title, body, assignee, state, milestone, labels] )` - * `title` - * `body` - * `assignee` - * `state` - * `milestone` - * `labels` + * `title`: string + * `body`: string + * `assignee`: string + * `state`: string + * `milestone`: integer + * `labels`: list of string Class `IssueComment` ==================== @@ -583,7 +583,7 @@ Deletion Modification ------------ * `edit( body )` - * `body` + * `body`: string Class `IssueEvent` ================== @@ -614,8 +614,8 @@ Deletion Modification ------------ * `edit( name, color )` - * `name` - * `color` + * `name`: string + * `color`: string Class `Milestone` ================= @@ -645,10 +645,10 @@ Labels Modification ------------ * `edit( title, [state, description, due_on] )` - * `title` - * `state` - * `description` - * `due_on` + * `title`: string + * `state`: string + * `description`: string + * `due_on`: string Class `NamedUser` ================= @@ -714,7 +714,7 @@ Repos * `get_repo( name )`: `Repository` * `name`: string * `get_repos( [type] )`: list of `Repository` - * `type` + * `type`: string Watched ------- @@ -770,12 +770,12 @@ Members Modification ------------ * `edit( [billing_email, blog, company, email, location, name] )` - * `billing_email` - * `blog` - * `company` - * `email` - * `location` - * `name` + * `billing_email`: string + * `blog`: string + * `company`: string + * `email`: string + * `location`: string + * `name`: string Public_members -------------- @@ -797,18 +797,18 @@ Repos * `has_issues`: bool * `has_wiki`: bool * `has_downloads`: bool - * `team_id` + * `team_id`: integer * `get_repo( name )`: `Repository` * `name`: string * `get_repos( [type] )`: list of `Repository` - * `type` + * `type`: string Teams ----- * `create_team( name, [repo_names, permission] )`: `Team` * `name`: string * `repo_names`: list of string - * `permission` + * `permission`: string * `get_team( id )`: `Team` * `id`: integer * `get_teams()`: list of `Team` @@ -867,12 +867,12 @@ Attributes Comments -------- * `create_comment( body, commit_id, path, position )`: `PullRequestComment` - * `body` - * `commit_id` - * `path` - * `position` + * `body`: string + * `commit_id`: string + * `path`: string + * `position`: integer * `get_comment( id )`: `PullRequestComment` - * `id` + * `id`: integer * `get_comments()`: list of `PullRequestComment` Commits @@ -892,9 +892,9 @@ Merging Modification ------------ * `edit( [title, body, state] )` - * `title` - * `body` - * `state` + * `title`: string + * `body`: string + * `state`: string Class `PullRequestComment` ========================== @@ -920,7 +920,7 @@ Deletion Modification ------------ * `edit( body )` - * `body` + * `body`: string Class `PullRequestFile` ======================= @@ -976,8 +976,8 @@ Attributes Comparison ---------- * `compare( base, head )` - * `base` - * `head` + * `base`: string + * `head`: string Branches -------- @@ -1248,8 +1248,8 @@ Members Modification ------------ * `edit( name, [permission] )` - * `name` - * `permission` + * `name`: string + * `permission`: string Repos ----- @@ -1279,5 +1279,5 @@ Deletion Modification ------------ * `edit( [title, key] )` - * `title` - * `key` + * `title`: string + * `key`: string diff --git a/src/github/AuthenticatedUser.py b/src/github/AuthenticatedUser.py index ddf0fd50..9b453466 100644 --- a/src/github/AuthenticatedUser.py +++ b/src/github/AuthenticatedUser.py @@ -173,6 +173,12 @@ class AuthenticatedUser( object ): ) def create_authorization( self, scopes = DefaultValueForOptionalParameters, note = DefaultValueForOptionalParameters, note_url = DefaultValueForOptionalParameters ): + if scopes is not DefaultValueForOptionalParameters: + assert isinstance( scopes, list ) and ( len( scopes ) == 0 or isinstance( scopes[ 0 ], ( str, unicode ) ) ), scopes + if note is not DefaultValueForOptionalParameters: + assert isinstance( note, ( str, unicode ) ), note + if note_url is not DefaultValueForOptionalParameters: + assert isinstance( note_url, ( str, unicode ) ), note_url post_parameters = { } if scopes is not DefaultValueForOptionalParameters: @@ -215,6 +221,8 @@ class AuthenticatedUser( object ): return Gist.Gist( self.__requester, data, completion = NoCompletion ) def create_key( self, title, key ): + assert isinstance( title, ( str, unicode ) ), title + assert isinstance( key, ( str, unicode ) ), key post_parameters = { "title": title, "key": key, @@ -301,6 +309,7 @@ class AuthenticatedUser( object ): self.__useAttributes( data ) def get_authorization( self, id ): + assert isinstance( id, int ), id status, headers, data = self.__requester.request( "GET", "https://api.github.com/authorizations" + "/" + str( id ), @@ -395,6 +404,7 @@ class AuthenticatedUser( object ): ) def get_key( self, id ): + assert isinstance( id, int ), id status, headers, data = self.__requester.request( "GET", "https://api.github.com/user/keys" + "/" + str( id ), @@ -452,6 +462,8 @@ class AuthenticatedUser( object ): return Repository.Repository( self.__requester, data, completion = NoCompletion ) def get_repos( self, type = DefaultValueForOptionalParameters ): + if type is not DefaultValueForOptionalParameters: + assert isinstance( type, ( str, unicode ) ), type status, headers, data = self.__requester.request( "GET", "https://api.github.com/user" + "/repos", diff --git a/src/github/Authorization.py b/src/github/Authorization.py index e57d6dff..56eadacd 100644 --- a/src/github/Authorization.py +++ b/src/github/Authorization.py @@ -66,6 +66,16 @@ class Authorization( object ): ) def edit( self, scopes = DefaultValueForOptionalParameters, add_scopes = DefaultValueForOptionalParameters, remove_scopes = DefaultValueForOptionalParameters, note = DefaultValueForOptionalParameters, note_url = DefaultValueForOptionalParameters ): + if scopes is not DefaultValueForOptionalParameters: + assert isinstance( scopes, list ) and ( len( scopes ) == 0 or isinstance( scopes[ 0 ], ( str, unicode ) ) ), scopes + if add_scopes is not DefaultValueForOptionalParameters: + assert isinstance( add_scopes, list ) and ( len( add_scopes ) == 0 or isinstance( add_scopes[ 0 ], ( str, unicode ) ) ), add_scopes + if remove_scopes is not DefaultValueForOptionalParameters: + assert isinstance( remove_scopes, list ) and ( len( remove_scopes ) == 0 or isinstance( remove_scopes[ 0 ], ( str, unicode ) ) ), remove_scopes + if note is not DefaultValueForOptionalParameters: + assert isinstance( note, ( str, unicode ) ), note + if note_url is not DefaultValueForOptionalParameters: + assert isinstance( note_url, ( str, unicode ) ), note_url post_parameters = { } if scopes is not DefaultValueForOptionalParameters: diff --git a/src/github/Commit.py b/src/github/Commit.py index 27318f4a..01fcac52 100644 --- a/src/github/Commit.py +++ b/src/github/Commit.py @@ -60,6 +60,13 @@ class Commit( object ): return self.__url def create_comment( self, body, line = DefaultValueForOptionalParameters, path = DefaultValueForOptionalParameters, position = DefaultValueForOptionalParameters ): + assert isinstance( body, ( str, unicode ) ), body + if line is not DefaultValueForOptionalParameters: + assert isinstance( line, int ), line + if path is not DefaultValueForOptionalParameters: + assert isinstance( path, ( str, unicode ) ), path + if position is not DefaultValueForOptionalParameters: + assert isinstance( position, int ), position post_parameters = { "body": body, } diff --git a/src/github/CommitComment.py b/src/github/CommitComment.py index 6163b2f7..18911043 100644 --- a/src/github/CommitComment.py +++ b/src/github/CommitComment.py @@ -77,6 +77,7 @@ class CommitComment( object ): ) def edit( self, body ): + assert isinstance( body, ( str, unicode ) ), body post_parameters = { "body": body, } diff --git a/src/github/Gist.py b/src/github/Gist.py index 15ff892a..41fd6ff5 100644 --- a/src/github/Gist.py +++ b/src/github/Gist.py @@ -93,6 +93,7 @@ class Gist( object ): return self.__user def create_comment( self, body ): + assert isinstance( body, ( str, unicode ) ), body post_parameters = { "body": body, } @@ -135,6 +136,7 @@ class Gist( object ): self.__useAttributes( data ) def get_comment( self, id ): + assert isinstance( id, int ), id status, headers, data = self.__requester.request( "GET", "https://api.github.com/gists/comments/" + str( id ), diff --git a/src/github/GistComment.py b/src/github/GistComment.py index 82f3e733..45fb8f51 100644 --- a/src/github/GistComment.py +++ b/src/github/GistComment.py @@ -43,6 +43,7 @@ class GistComment( object ): ) def edit( self, body ): + assert isinstance( body, ( str, unicode ) ), body post_parameters = { "body": body, } diff --git a/src/github/GitRef.py b/src/github/GitRef.py index aa1aecf7..7abaef90 100644 --- a/src/github/GitRef.py +++ b/src/github/GitRef.py @@ -31,6 +31,9 @@ class GitRef( object ): ) def edit( self, sha, force = DefaultValueForOptionalParameters ): + assert isinstance( sha, ( str, unicode ) ), sha + if force is not DefaultValueForOptionalParameters: + assert isinstance( force, bool ), force post_parameters = { "sha": sha, } diff --git a/src/github/Hook.py b/src/github/Hook.py index b48d4e29..f7ee348b 100644 --- a/src/github/Hook.py +++ b/src/github/Hook.py @@ -54,6 +54,15 @@ class Hook( object ): ) def edit( self, name, config, events = DefaultValueForOptionalParameters, add_events = DefaultValueForOptionalParameters, remove_events = DefaultValueForOptionalParameters, active = DefaultValueForOptionalParameters ): + assert isinstance( name, ( str, unicode ) ), name + if events is not DefaultValueForOptionalParameters: + assert isinstance( events, list ) and ( len( events ) == 0 or isinstance( events[ 0 ], ( str, unicode ) ) ), events + if add_events is not DefaultValueForOptionalParameters: + assert isinstance( add_events, list ) and ( len( add_events ) == 0 or isinstance( add_events[ 0 ], ( str, unicode ) ) ), add_events + if remove_events is not DefaultValueForOptionalParameters: + assert isinstance( remove_events, list ) and ( len( remove_events ) == 0 or isinstance( remove_events[ 0 ], ( str, unicode ) ) ), remove_events + if active is not DefaultValueForOptionalParameters: + assert isinstance( active, bool ), active post_parameters = { "name": name, "config": config, diff --git a/src/github/Issue.py b/src/github/Issue.py index 4dcbd6d4..c41fa818 100644 --- a/src/github/Issue.py +++ b/src/github/Issue.py @@ -138,6 +138,18 @@ class Issue( object ): ) def edit( self, title = DefaultValueForOptionalParameters, body = DefaultValueForOptionalParameters, assignee = DefaultValueForOptionalParameters, state = DefaultValueForOptionalParameters, milestone = DefaultValueForOptionalParameters, labels = DefaultValueForOptionalParameters ): + if title is not DefaultValueForOptionalParameters: + assert isinstance( title, ( str, unicode ) ), title + if body is not DefaultValueForOptionalParameters: + assert isinstance( body, ( str, unicode ) ), body + if assignee is not DefaultValueForOptionalParameters: + assert isinstance( assignee, ( str, unicode ) ), assignee + if state is not DefaultValueForOptionalParameters: + assert isinstance( state, ( str, unicode ) ), state + if milestone is not DefaultValueForOptionalParameters: + assert isinstance( milestone, int ), milestone + if labels is not DefaultValueForOptionalParameters: + assert isinstance( labels, list ) and ( len( labels ) == 0 or isinstance( labels[ 0 ], ( str, unicode ) ) ), labels post_parameters = { } if title is not DefaultValueForOptionalParameters: @@ -160,6 +172,7 @@ class Issue( object ): self.__useAttributes( data ) def get_comment( self, id ): + assert isinstance( id, int ), id status, headers, data = self.__requester.request( "GET", self.__requester.parentUrl( str( self.url ) ) + "/comments" + "/" + str( id ), diff --git a/src/github/IssueComment.py b/src/github/IssueComment.py index 886f5dbf..ae16a452 100644 --- a/src/github/IssueComment.py +++ b/src/github/IssueComment.py @@ -43,6 +43,7 @@ class IssueComment( object ): ) def edit( self, body ): + assert isinstance( body, ( str, unicode ) ), body post_parameters = { "body": body, } diff --git a/src/github/Label.py b/src/github/Label.py index 7c355344..1881c321 100644 --- a/src/github/Label.py +++ b/src/github/Label.py @@ -31,6 +31,8 @@ class Label( object ): ) def edit( self, name, color ): + assert isinstance( name, ( str, unicode ) ), name + assert isinstance( color, ( str, unicode ) ), color post_parameters = { "name": name, "color": color, diff --git a/src/github/Milestone.py b/src/github/Milestone.py index 635ea998..5b84fb3f 100644 --- a/src/github/Milestone.py +++ b/src/github/Milestone.py @@ -64,6 +64,13 @@ class Milestone( object ): ) def edit( self, title, state = DefaultValueForOptionalParameters, description = DefaultValueForOptionalParameters, due_on = DefaultValueForOptionalParameters ): + assert isinstance( title, ( str, unicode ) ), title + if state is not DefaultValueForOptionalParameters: + assert isinstance( state, ( str, unicode ) ), state + if description is not DefaultValueForOptionalParameters: + assert isinstance( description, ( str, unicode ) ), description + if due_on is not DefaultValueForOptionalParameters: + assert isinstance( due_on, ( str, unicode ) ), due_on post_parameters = { "title": title, } diff --git a/src/github/NamedUser.py b/src/github/NamedUser.py index 20614efd..3ec84805 100644 --- a/src/github/NamedUser.py +++ b/src/github/NamedUser.py @@ -280,6 +280,8 @@ class NamedUser( object ): return Repository.Repository( self.__requester, data, completion = NoCompletion ) def get_repos( self, type = DefaultValueForOptionalParameters ): + if type is not DefaultValueForOptionalParameters: + assert isinstance( type, ( str, unicode ) ), type status, headers, data = self.__requester.request( "GET", str( self.url ) + "/repos", diff --git a/src/github/Organization.py b/src/github/Organization.py index 9b651011..05dc2e1d 100644 --- a/src/github/Organization.py +++ b/src/github/Organization.py @@ -169,6 +169,8 @@ class Organization( object ): assert isinstance( has_wiki, bool ), has_wiki if has_downloads is not DefaultValueForOptionalParameters: assert isinstance( has_downloads, bool ), has_downloads + if team_id is not DefaultValueForOptionalParameters: + assert isinstance( team_id, int ), team_id post_parameters = { "name": name, } @@ -197,6 +199,8 @@ class Organization( object ): assert isinstance( name, ( str, unicode ) ), name if repo_names is not DefaultValueForOptionalParameters: assert isinstance( repo_names, list ) and ( len( repo_names ) == 0 or isinstance( repo_names[ 0 ], ( str, unicode ) ) ), repo_names + if permission is not DefaultValueForOptionalParameters: + assert isinstance( permission, ( str, unicode ) ), permission post_parameters = { "name": name, } @@ -212,6 +216,18 @@ class Organization( object ): return Team.Team( self.__requester, data, completion = NoCompletion ) def edit( self, billing_email = DefaultValueForOptionalParameters, blog = DefaultValueForOptionalParameters, company = DefaultValueForOptionalParameters, email = DefaultValueForOptionalParameters, location = DefaultValueForOptionalParameters, name = DefaultValueForOptionalParameters ): + if billing_email is not DefaultValueForOptionalParameters: + assert isinstance( billing_email, ( str, unicode ) ), billing_email + if blog is not DefaultValueForOptionalParameters: + assert isinstance( blog, ( str, unicode ) ), blog + if company is not DefaultValueForOptionalParameters: + assert isinstance( company, ( str, unicode ) ), company + if email is not DefaultValueForOptionalParameters: + assert isinstance( email, ( str, unicode ) ), email + if location is not DefaultValueForOptionalParameters: + assert isinstance( location, ( str, unicode ) ), location + if name is not DefaultValueForOptionalParameters: + assert isinstance( name, ( str, unicode ) ), name post_parameters = { } if billing_email is not DefaultValueForOptionalParameters: @@ -282,6 +298,8 @@ class Organization( object ): return Repository.Repository( self.__requester, data, completion = NoCompletion ) def get_repos( self, type = DefaultValueForOptionalParameters ): + if type is not DefaultValueForOptionalParameters: + assert isinstance( type, ( str, unicode ) ), type status, headers, data = self.__requester.request( "GET", str( self.url ) + "/repos", diff --git a/src/github/PullRequest.py b/src/github/PullRequest.py index 6fb44407..7de07a40 100644 --- a/src/github/PullRequest.py +++ b/src/github/PullRequest.py @@ -148,6 +148,10 @@ class PullRequest( object ): return self.__user def create_comment( self, body, commit_id, path, position ): + assert isinstance( body, ( str, unicode ) ), body + assert isinstance( commit_id, ( str, unicode ) ), commit_id + assert isinstance( path, ( str, unicode ) ), path + assert isinstance( position, int ), position post_parameters = { "body": body, "commit_id": commit_id, @@ -162,6 +166,12 @@ class PullRequest( object ): return PullRequestComment.PullRequestComment( self.__requester, data, completion = NoCompletion ) def edit( self, title = DefaultValueForOptionalParameters, body = DefaultValueForOptionalParameters, state = DefaultValueForOptionalParameters ): + if title is not DefaultValueForOptionalParameters: + assert isinstance( title, ( str, unicode ) ), title + if body is not DefaultValueForOptionalParameters: + assert isinstance( body, ( str, unicode ) ), body + if state is not DefaultValueForOptionalParameters: + assert isinstance( state, ( str, unicode ) ), state post_parameters = { } if title is not DefaultValueForOptionalParameters: @@ -178,6 +188,7 @@ class PullRequest( object ): self.__useAttributes( data ) def get_comment( self, id ): + assert isinstance( id, int ), id status, headers, data = self.__requester.request( "GET", self.__requester.parentUrl( str( self.url ) ) + "/comments" + "/" + str( id ), diff --git a/src/github/PullRequestComment.py b/src/github/PullRequestComment.py index 730fd6e0..8fa9ccd0 100644 --- a/src/github/PullRequestComment.py +++ b/src/github/PullRequestComment.py @@ -77,6 +77,7 @@ class PullRequestComment( object ): ) def edit( self, body ): + assert isinstance( body, ( str, unicode ) ), body post_parameters = { "body": body, } diff --git a/src/github/Team.py b/src/github/Team.py index 95d03687..999d6396 100644 --- a/src/github/Team.py +++ b/src/github/Team.py @@ -69,6 +69,9 @@ class Team( object ): ) def edit( self, name, permission = DefaultValueForOptionalParameters ): + assert isinstance( name, ( str, unicode ) ), name + if permission is not DefaultValueForOptionalParameters: + assert isinstance( permission, ( str, unicode ) ), permission post_parameters = { "name": name, } diff --git a/src/github/UserKey.py b/src/github/UserKey.py index 02758bf0..32c8b230 100644 --- a/src/github/UserKey.py +++ b/src/github/UserKey.py @@ -46,6 +46,10 @@ class UserKey( object ): ) def edit( self, title = DefaultValueForOptionalParameters, key = DefaultValueForOptionalParameters ): + if title is not DefaultValueForOptionalParameters: + assert isinstance( title, ( str, unicode ) ), title + if key is not DefaultValueForOptionalParameters: + assert isinstance( key, ( str, unicode ) ), key post_parameters = { } if title is not DefaultValueForOptionalParameters: