{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/comments/49781828","id":49781828,"diff_hunk":"@@ -0,0 +1,183 @@\n+module Azure\n+  module Armrest\n+    class Configuration\n+      # Used to store unique token information.\n+      @@tokens = Hash.new([])\n+\n+      # The client ID used to gather token information.\n+      attr_accessor :client_id\n+\n+      # The client key used to gather token information.\n+      attr_accessor :client_key\n+\n+      # The tenant ID used to gather token information.\n+      attr_accessor :tenant_id\n+\n+      # The resource group used for a given http request.\n+      attr_accessor :resource_group\n+\n+      # The API version used for a given http request. The default is 2015-01-01.\n+      attr_accessor :api_version\n+\n+      # The grant type. The default is client_credentials\n+      attr_accessor :grant_type\n+\n+      # The content type specified for http requests. The default is 'application/json'\n+      attr_accessor :content_type\n+\n+      # The accept type specified for http request results. The default is 'application/json'\n+      attr_accessor :accept\n+\n+      # Explicitly set the token.\n+      attr_writer :token\n+\n+      # Yields a new Azure::Armrest::Configuration objects. Note that you must\n+      # specify a client_id and client_key. All other parameters are optional.\n+      #\n+      # Example:\n+      #\n+      #   config = Azure::Armrest::Configuration.new(\n+      #     :client_id  => 'xxxx',\n+      #     :client_key => 'yyyy',\n+      #     :tenant_id  => 'zzzz'\n+      #   )\n+      #\n+      def initialize(hash)\n+        @subscriptions = Hash.new([]) # Used internally","path":"lib/azure/armrest/configuration.rb","position":46,"original_position":46,"commit_id":"d250ea8adc413d9658ea36b4b0d1c0b75b942395","original_commit_id":"d250ea8adc413d9658ea36b4b0d1c0b75b942395","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":"I don't agree. Since it's unique per configuration, it does not require a class variable. That's one of the changes I wanted to make.","created_at":"2016-01-14T20:40:08Z","updated_at":"2016-01-14T20:40:08Z","html_url":"https://github.com/ManageIQ/azure-armrest/pull/115#discussion_r49781828","pull_request_url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/115","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/comments/49781828"},"html":{"href":"https://github.com/ManageIQ/azure-armrest/pull/115#discussion_r49781828"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/115","id":53908103,"html_url":"https://github.com/ManageIQ/azure-armrest/pull/115","diff_url":"https://github.com/ManageIQ/azure-armrest/pull/115.diff","patch_url":"https://github.com/ManageIQ/azure-armrest/pull/115.patch","issue_url":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/115","number":115,"state":"open","locked":false,"title":"[WIP] Configuration overhaul","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":"Do not merge yet. Work in progress.\r\n\r\nAfter hitting an issue with using service classes within other service classes, I decided that it would be better to revamp the configuration handling as a starting point.\r\n\r\nPart of that means splitting out the configuration handler into its own class and in its own file. I think this will make maintenance easier than having a struct + block with methods defined on the fly, since it's easier to identify what is happening and where.\r\n\r\nAnother advantage is that we can more robustly set default values, instead of creating a configuration object, and then setting values after the fact.\r\n\r\nTL;DR: I think splitting it out into its own bonafide class will make it easier to maintain, test and develop going forward. ","created_at":"2015-12-16T22:27:46Z","updated_at":"2016-01-14T20:40:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c53c8643fd12276c25cce999f86646fa8d51dc37","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/115/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/115/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/115/comments","statuses_url":"https://api.github.com/repos/ManageIQ/azure-armrest/statuses/d250ea8adc413d9658ea36b4b0d1c0b75b942395","head":{"label":"djberg96:configuration","ref":"configuration","sha":"d250ea8adc413d9658ea36b4b0d1c0b75b942395","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":"2016-01-14T17:26:00Z","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":309,"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":"f141ff834bb8d7bb8029b9e4abf0fe1f95f0ca1f","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-12-17T15:31:13Z","pushed_at":"2016-01-14T17:26:00Z","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":336,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":6,"forks":5,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/115"},"html":{"href":"https://github.com/ManageIQ/azure-armrest/pull/115"},"issue":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/115"},"comments":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/pulls/115/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/115/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/azure-armrest/statuses/d250ea8adc413d9658ea36b4b0d1c0b75b942395"}}}}