{"action":"opened","number":69,"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/69","id":35440561,"html_url":"https://github.com/SatelliteQE/nailgun/pull/69","diff_url":"https://github.com/SatelliteQE/nailgun/pull/69.diff","patch_url":"https://github.com/SatelliteQE/nailgun/pull/69.patch","issue_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/69","number":69,"state":"open","locked":false,"title":"Drop `Meta.api_names`","user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"body":"Field names on an entity do not always match what the server expects to receive\r\nin a request or what the server returns in a response. Class attribute\r\n`Meta.api_names` is an attempt to address these mis-matches. It is a dict of\r\nlocal-remote name mappings. For example, from class `ContentViewFilter`:\r\n\r\n```python\r\nclass Meta(object):\r\n    \"\"\"Non-field information about this entity.\"\"\"\r\n    api_names = {'filter_type': 'type'}\r\n```\r\n\r\nUnfortunately, `Meta.api_names` is both complex and limited. It is complex\r\nbecause cause and effect are distant. The presence of name mappings on\r\nindividual classes in module `nailgun.entities` causes logic in several methods\r\nin `nailgun.entity_mixins` to execute — that's not obvious! It is limited\r\nbecause it cannot handle certain use cases, such as the fact that a name mapping\r\nshould be used for the `Subscription` entity, but only when POSTing.\r\n\r\nAn easier approach is to simply extend or override inherited methods such as\r\n`create_payload` and `read` when needed. For example, the `Media` entity extends\r\nboth in order to deal with a naming conflict between an inherited method and a\r\nfield.\r\n\r\nTest results against an upstream system:\r\n\r\n    $ nosetests tests/foreman/api/test_multiple_paths.py\r\n    ...S...S......S...............................................................S...S..........................................................................................................................................SSSS.SSSSSS..S.S.SSSSSS...SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\r\n    ----------------------------------------------------------------------\r\n    Ran 278 tests in 469.999s\r\n\r\n    OK (SKIP=54)\r\n\r\nNote that these test results require the use of a small change to the test\r\nmodule that will be submitted in a separate PR. (Module `test_multiple_paths` is\r\nthe only one in Robottelo that makes use of `Meta.api_naems`.) Without the\r\nchange, two tests fail.","created_at":"2015-05-14T17:05:17Z","updated_at":"2015-05-14T17:05:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/69/commits","review_comments_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/69/comments","review_comment_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/69/comments","statuses_url":"https://api.github.com/repos/SatelliteQE/nailgun/statuses/458841330e38da14e29c7ffdf4dd20bbc00bbee7","head":{"label":"Ichimonji10:api-names","ref":"api-names","sha":"458841330e38da14e29c7ffdf4dd20bbc00bbee7","user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"repo":{"id":34913792,"name":"nailgun","full_name":"Ichimonji10/nailgun","owner":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ichimonji10/nailgun","description":"Why use a hammer when you can use a nailgun.","fork":true,"url":"https://api.github.com/repos/Ichimonji10/nailgun","forks_url":"https://api.github.com/repos/Ichimonji10/nailgun/forks","keys_url":"https://api.github.com/repos/Ichimonji10/nailgun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ichimonji10/nailgun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ichimonji10/nailgun/teams","hooks_url":"https://api.github.com/repos/Ichimonji10/nailgun/hooks","issue_events_url":"https://api.github.com/repos/Ichimonji10/nailgun/issues/events{/number}","events_url":"https://api.github.com/repos/Ichimonji10/nailgun/events","assignees_url":"https://api.github.com/repos/Ichimonji10/nailgun/assignees{/user}","branches_url":"https://api.github.com/repos/Ichimonji10/nailgun/branches{/branch}","tags_url":"https://api.github.com/repos/Ichimonji10/nailgun/tags","blobs_url":"https://api.github.com/repos/Ichimonji10/nailgun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ichimonji10/nailgun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ichimonji10/nailgun/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ichimonji10/nailgun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ichimonji10/nailgun/statuses/{sha}","languages_url":"https://api.github.com/repos/Ichimonji10/nailgun/languages","stargazers_url":"https://api.github.com/repos/Ichimonji10/nailgun/stargazers","contributors_url":"https://api.github.com/repos/Ichimonji10/nailgun/contributors","subscribers_url":"https://api.github.com/repos/Ichimonji10/nailgun/subscribers","subscription_url":"https://api.github.com/repos/Ichimonji10/nailgun/subscription","commits_url":"https://api.github.com/repos/Ichimonji10/nailgun/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ichimonji10/nailgun/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ichimonji10/nailgun/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ichimonji10/nailgun/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ichimonji10/nailgun/contents/{+path}","compare_url":"https://api.github.com/repos/Ichimonji10/nailgun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ichimonji10/nailgun/merges","archive_url":"https://api.github.com/repos/Ichimonji10/nailgun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ichimonji10/nailgun/downloads","issues_url":"https://api.github.com/repos/Ichimonji10/nailgun/issues{/number}","pulls_url":"https://api.github.com/repos/Ichimonji10/nailgun/pulls{/number}","milestones_url":"https://api.github.com/repos/Ichimonji10/nailgun/milestones{/number}","notifications_url":"https://api.github.com/repos/Ichimonji10/nailgun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ichimonji10/nailgun/labels{/name}","releases_url":"https://api.github.com/repos/Ichimonji10/nailgun/releases{/id}","created_at":"2015-05-01T17:12:25Z","updated_at":"2015-05-07T15:42:47Z","pushed_at":"2015-05-14T17:03:55Z","git_url":"git://github.com/Ichimonji10/nailgun.git","ssh_url":"git@github.com:Ichimonji10/nailgun.git","clone_url":"https://github.com/Ichimonji10/nailgun.git","svn_url":"https://github.com/Ichimonji10/nailgun","homepage":null,"size":355,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SatelliteQE:master","ref":"master","sha":"4fa4e6b2b68b64e7b1f91f1b8369db58afe10034","user":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"repo":{"id":27888295,"name":"nailgun","full_name":"SatelliteQE/nailgun","owner":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SatelliteQE/nailgun","description":"Why use a hammer when you can use a nailgun.","fork":false,"url":"https://api.github.com/repos/SatelliteQE/nailgun","forks_url":"https://api.github.com/repos/SatelliteQE/nailgun/forks","keys_url":"https://api.github.com/repos/SatelliteQE/nailgun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SatelliteQE/nailgun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SatelliteQE/nailgun/teams","hooks_url":"https://api.github.com/repos/SatelliteQE/nailgun/hooks","issue_events_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/events{/number}","events_url":"https://api.github.com/repos/SatelliteQE/nailgun/events","assignees_url":"https://api.github.com/repos/SatelliteQE/nailgun/assignees{/user}","branches_url":"https://api.github.com/repos/SatelliteQE/nailgun/branches{/branch}","tags_url":"https://api.github.com/repos/SatelliteQE/nailgun/tags","blobs_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/refs{/sha}","trees_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SatelliteQE/nailgun/statuses/{sha}","languages_url":"https://api.github.com/repos/SatelliteQE/nailgun/languages","stargazers_url":"https://api.github.com/repos/SatelliteQE/nailgun/stargazers","contributors_url":"https://api.github.com/repos/SatelliteQE/nailgun/contributors","subscribers_url":"https://api.github.com/repos/SatelliteQE/nailgun/subscribers","subscription_url":"https://api.github.com/repos/SatelliteQE/nailgun/subscription","commits_url":"https://api.github.com/repos/SatelliteQE/nailgun/commits{/sha}","git_commits_url":"https://api.github.com/repos/SatelliteQE/nailgun/git/commits{/sha}","comments_url":"https://api.github.com/repos/SatelliteQE/nailgun/comments{/number}","issue_comment_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues/comments{/number}","contents_url":"https://api.github.com/repos/SatelliteQE/nailgun/contents/{+path}","compare_url":"https://api.github.com/repos/SatelliteQE/nailgun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SatelliteQE/nailgun/merges","archive_url":"https://api.github.com/repos/SatelliteQE/nailgun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SatelliteQE/nailgun/downloads","issues_url":"https://api.github.com/repos/SatelliteQE/nailgun/issues{/number}","pulls_url":"https://api.github.com/repos/SatelliteQE/nailgun/pulls{/number}","milestones_url":"https://api.github.com/repos/SatelliteQE/nailgun/milestones{/number}","notifications_url":"https://api.github.com/repos/SatelliteQE/nailgun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SatelliteQE/nailgun/labels{/name}","releases_url":"https://api.github.com/repos/SatelliteQE/nailgun/releases{/id}","created_at":"2014-12-11T19:39:59Z","updated_at":"2015-05-08T20:46:59Z","pushed_at":"2015-05-11T18:23:40Z","git_url":"git://github.com/SatelliteQE/nailgun.git","ssh_url":"git@github.com:SatelliteQE/nailgun.git","clone_url":"https://github.com/SatelliteQE/nailgun.git","svn_url":"https://github.com/SatelliteQE/nailgun","homepage":null,"size":1100,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":22,"forks":10,"open_issues":22,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/69"},"html":{"href":"https://github.com/SatelliteQE/nailgun/pull/69"},"issue":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/issues/69"},"comments":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/SatelliteQE/nailgun/statuses/458841330e38da14e29c7ffdf4dd20bbc00bbee7"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":33,"deletions":31,"changed_files":2}}