{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/comments/40836520","id":40836520,"diff_hunk":"@@ -0,0 +1,81 @@\n+require 'delegate'\n+require 'ostruct'\n+\n+module Azure\n+  module ArmRest\n+    # Base class for JSON wrapper classes. Each Service class should have\n+    # a corresponding class that wraps the JSON it collects, and each of\n+    # them should subclass this base class.\n+    class BaseWrapper < Delegator","path":"lib/azure/armrest/wrapper/base_wrapper.rb","position":9,"original_position":9,"commit_id":"51412f15b333461ae9cdb760b981f01041c01f6e","original_commit_id":"51412f15b333461ae9cdb760b981f01041c01f6e","user":{"login":"bzwei","id":7047579,"avatar_url":"https://avatars.githubusercontent.com/u/7047579?v=3","gravatar_id":"","url":"https://api.github.com/users/bzwei","html_url":"https://github.com/bzwei","followers_url":"https://api.github.com/users/bzwei/followers","following_url":"https://api.github.com/users/bzwei/following{/other_user}","gists_url":"https://api.github.com/users/bzwei/gists{/gist_id}","starred_url":"https://api.github.com/users/bzwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzwei/subscriptions","organizations_url":"https://api.github.com/users/bzwei/orgs","repos_url":"https://api.github.com/users/bzwei/repos","events_url":"https://api.github.com/users/bzwei/events{/privacy}","received_events_url":"https://api.github.com/users/bzwei/received_events","type":"User","site_admin":false},"body":"Can we rename `wrapper` to `model` for both the directory and the class name? `Fog` also uses the term `model` although it is not an  `ActiveRecord`","created_at":"2015-09-30T19:02:18Z","updated_at":"2015-09-30T19:02:18Z","html_url":"https://github.com/ManageIQ/azure-armrest/pull/79#discussion_r40836520","pull_request_url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/79","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/comments/40836520"},"html":{"href":"https://github.com/ManageIQ/azure-armrest/pull/79#discussion_r40836520"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/79"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/79","id":46322256,"html_url":"https://github.com/ManageIQ/azure-armrest/pull/79","diff_url":"https://github.com/ManageIQ/azure-armrest/pull/79.diff","patch_url":"https://github.com/ManageIQ/azure-armrest/pull/79.patch","issue_url":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/79","number":79,"state":"open","locked":false,"title":"Implement JSON base wrapper classes","user":{"login":"djberg96","id":78529,"avatar_url":"https://avatars.githubusercontent.com/u/78529?v=3","gravatar_id":"","url":"https://api.github.com/users/djberg96","html_url":"https://github.com/djberg96","followers_url":"https://api.github.com/users/djberg96/followers","following_url":"https://api.github.com/users/djberg96/following{/other_user}","gists_url":"https://api.github.com/users/djberg96/gists{/gist_id}","starred_url":"https://api.github.com/users/djberg96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djberg96/subscriptions","organizations_url":"https://api.github.com/users/djberg96/orgs","repos_url":"https://api.github.com/users/djberg96/repos","events_url":"https://api.github.com/users/djberg96/events{/privacy}","received_events_url":"https://api.github.com/users/djberg96/received_events","type":"User","site_admin":false},"body":"This replaces https://github.com/ManageIQ/azure-armrest/pull/21\r\n\r\nWith JSON wrapper classes we can get real classes back instead of plain hashes, and add custom methods to them as we see fit.\r\n\r\nThis PR does not modify the service classes. They still return hashes for now, but you can still use these wrapper classes by calling .to_json first. Basically, I wanted this first step reviewed before altering other code.\r\n\r\nSome sample code:\r\n\r\n    vmm = Azure::Armrest::VirtualMachineService.new(conf)\r\n    json = vmm.get('miqazure-win2k8', 'miqazure-dan1', true).to_json\r\n    vm = Azure::Armrest::VirtualMachine.new(json)\r\n\r\n    p vm.properties.hardware_profile.vm_size # => \"Standard_A1\"\r\n    p vm.properties.storage_profile.os_disk.os_type # => \"Windows\"\r\n    p vm.properties.os_profile.computer_name # => \"miqazure-win2k8\"","created_at":"2015-09-29T19:41:49Z","updated_at":"2015-09-30T19:02:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24fc9657fbd5fffbcb5979cb9210b7708b686f95","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/79/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/79/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/79/comments","statuses_url":"https://api.github.com/repos/ManageIQ/azure-armrest/statuses/51412f15b333461ae9cdb760b981f01041c01f6e","head":{"label":"djberg96:json_wrapper2","ref":"json_wrapper2","sha":"51412f15b333461ae9cdb760b981f01041c01f6e","user":{"login":"djberg96","id":78529,"avatar_url":"https://avatars.githubusercontent.com/u/78529?v=3","gravatar_id":"","url":"https://api.github.com/users/djberg96","html_url":"https://github.com/djberg96","followers_url":"https://api.github.com/users/djberg96/followers","following_url":"https://api.github.com/users/djberg96/following{/other_user}","gists_url":"https://api.github.com/users/djberg96/gists{/gist_id}","starred_url":"https://api.github.com/users/djberg96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djberg96/subscriptions","organizations_url":"https://api.github.com/users/djberg96/orgs","repos_url":"https://api.github.com/users/djberg96/repos","events_url":"https://api.github.com/users/djberg96/events{/privacy}","received_events_url":"https://api.github.com/users/djberg96/received_events","type":"User","site_admin":false},"repo":{"id":37276845,"name":"azure-armrest","full_name":"djberg96/azure-armrest","owner":{"login":"djberg96","id":78529,"avatar_url":"https://avatars.githubusercontent.com/u/78529?v=3","gravatar_id":"","url":"https://api.github.com/users/djberg96","html_url":"https://github.com/djberg96","followers_url":"https://api.github.com/users/djberg96/followers","following_url":"https://api.github.com/users/djberg96/following{/other_user}","gists_url":"https://api.github.com/users/djberg96/gists{/gist_id}","starred_url":"https://api.github.com/users/djberg96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djberg96/subscriptions","organizations_url":"https://api.github.com/users/djberg96/orgs","repos_url":"https://api.github.com/users/djberg96/repos","events_url":"https://api.github.com/users/djberg96/events{/privacy}","received_events_url":"https://api.github.com/users/djberg96/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/djberg96/azure-armrest","description":"Ruby interface for Azure using the new REST API","fork":true,"url":"https://api.github.com/repos/djberg96/azure-armrest","forks_url":"https://api.github.com/repos/djberg96/azure-armrest/forks","keys_url":"https://api.github.com/repos/djberg96/azure-armrest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/djberg96/azure-armrest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/djberg96/azure-armrest/teams","hooks_url":"https://api.github.com/repos/djberg96/azure-armrest/hooks","issue_events_url":"https://api.github.com/repos/djberg96/azure-armrest/issues/events{/number}","events_url":"https://api.github.com/repos/djberg96/azure-armrest/events","assignees_url":"https://api.github.com/repos/djberg96/azure-armrest/assignees{/user}","branches_url":"https://api.github.com/repos/djberg96/azure-armrest/branches{/branch}","tags_url":"https://api.github.com/repos/djberg96/azure-armrest/tags","blobs_url":"https://api.github.com/repos/djberg96/azure-armrest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/djberg96/azure-armrest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/djberg96/azure-armrest/git/refs{/sha}","trees_url":"https://api.github.com/repos/djberg96/azure-armrest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/djberg96/azure-armrest/statuses/{sha}","languages_url":"https://api.github.com/repos/djberg96/azure-armrest/languages","stargazers_url":"https://api.github.com/repos/djberg96/azure-armrest/stargazers","contributors_url":"https://api.github.com/repos/djberg96/azure-armrest/contributors","subscribers_url":"https://api.github.com/repos/djberg96/azure-armrest/subscribers","subscription_url":"https://api.github.com/repos/djberg96/azure-armrest/subscription","commits_url":"https://api.github.com/repos/djberg96/azure-armrest/commits{/sha}","git_commits_url":"https://api.github.com/repos/djberg96/azure-armrest/git/commits{/sha}","comments_url":"https://api.github.com/repos/djberg96/azure-armrest/comments{/number}","issue_comment_url":"https://api.github.com/repos/djberg96/azure-armrest/issues/comments{/number}","contents_url":"https://api.github.com/repos/djberg96/azure-armrest/contents/{+path}","compare_url":"https://api.github.com/repos/djberg96/azure-armrest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/djberg96/azure-armrest/merges","archive_url":"https://api.github.com/repos/djberg96/azure-armrest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/djberg96/azure-armrest/downloads","issues_url":"https://api.github.com/repos/djberg96/azure-armrest/issues{/number}","pulls_url":"https://api.github.com/repos/djberg96/azure-armrest/pulls{/number}","milestones_url":"https://api.github.com/repos/djberg96/azure-armrest/milestones{/number}","notifications_url":"https://api.github.com/repos/djberg96/azure-armrest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/djberg96/azure-armrest/labels{/name}","releases_url":"https://api.github.com/repos/djberg96/azure-armrest/releases{/id}","created_at":"2015-06-11T17:55:30Z","updated_at":"2015-06-11T17:55:30Z","pushed_at":"2015-09-30T14:11:38Z","git_url":"git://github.com/djberg96/azure-armrest.git","ssh_url":"git@github.com:djberg96/azure-armrest.git","clone_url":"https://github.com/djberg96/azure-armrest.git","svn_url":"https://github.com/djberg96/azure-armrest","homepage":null,"size":513,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ManageIQ:master","ref":"master","sha":"b33c5c4c45796894dc22fb00e7bc92b096f27626","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":35620488,"name":"azure-armrest","full_name":"ManageIQ/azure-armrest","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/azure-armrest","description":"Ruby interface for Azure using the new REST API","fork":false,"url":"https://api.github.com/repos/ManageIQ/azure-armrest","forks_url":"https://api.github.com/repos/ManageIQ/azure-armrest/forks","keys_url":"https://api.github.com/repos/ManageIQ/azure-armrest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/azure-armrest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/azure-armrest/teams","hooks_url":"https://api.github.com/repos/ManageIQ/azure-armrest/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/azure-armrest/events","assignees_url":"https://api.github.com/repos/ManageIQ/azure-armrest/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/azure-armrest/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/azure-armrest/tags","blobs_url":"https://api.github.com/repos/ManageIQ/azure-armrest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/azure-armrest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/azure-armrest/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/azure-armrest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/azure-armrest/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/azure-armrest/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/azure-armrest/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/azure-armrest/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/azure-armrest/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/azure-armrest/subscription","commits_url":"https://api.github.com/repos/ManageIQ/azure-armrest/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/azure-armrest/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/azure-armrest/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/azure-armrest/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/azure-armrest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/azure-armrest/merges","archive_url":"https://api.github.com/repos/ManageIQ/azure-armrest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/azure-armrest/downloads","issues_url":"https://api.github.com/repos/ManageIQ/azure-armrest/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/azure-armrest/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/azure-armrest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/azure-armrest/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/azure-armrest/releases{/id}","created_at":"2015-05-14T15:51:27Z","updated_at":"2015-06-11T17:52:00Z","pushed_at":"2015-09-30T14:11:39Z","git_url":"git://github.com/ManageIQ/azure-armrest.git","ssh_url":"git@github.com:ManageIQ/azure-armrest.git","clone_url":"https://github.com/ManageIQ/azure-armrest.git","svn_url":"https://github.com/ManageIQ/azure-armrest","homepage":null,"size":963,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/79"},"html":{"href":"https://github.com/ManageIQ/azure-armrest/pull/79"},"issue":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/79"},"comments":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/statuses/51412f15b333461ae9cdb760b981f01041c01f6e"}}}}