{"action":"created","comment":{"url":"https://api.github.com/repos/projectjellyfish/api/pulls/comments/25802868","id":25802868,"diff_hunk":"@@ -0,0 +1,86 @@\n+class ManageIqProductsController < ApplicationController\n+  after_action :verify_authorized\n+\n+  before_action :load_manage_iq_product_params, only: [:create, :update]\n+  before_action :load_manage_iq_product, only: [:update]\n+\n+  PRODUCT_PRICE_REGEX = /\\d{1,6}(\\.\\d{0,4})?/\n+\n+  api :POST, '/products', 'Creates product'\n+  param :name, String, desc: 'Product Name'\n+  param :description, String, desc: 'Short description'\n+  param :service_catalog_id, Integer, desc: 'ManageIQ Catalog Id'\n+  param :service_type_id, Integer, desc: 'ManageIQ Catalog Item Id'\n+  param :chef_role, String, desc: 'Chef role'\n+  param :product_type_id, Integer, desc: 'ProductType Id'\n+  param :cloud_id, Integer, desc: 'Cloud Id'\n+  param :options, Array, desc: 'Options', allow_nil: true\n+  param :hourly_price, PRODUCT_PRICE_REGEX, required: false, desc: 'Cost per Hour'\n+  param :monthly_price, PRODUCT_PRICE_REGEX, required: false, desc: 'Cost per Month'\n+  param :setup_price, PRODUCT_PRICE_REGEX, required: false, desc: 'Initial Setup Fee'\n+  error code: 422, desc: ParameterValidation::Messages.missing\n+\n+  def create\n+    @manage_iq_product = ManageIqProduct.new(@manage_iq_products_params)\n+    @manage_iq_product.product = Product.new(@products_params)\n+    authorize @manage_iq_product\n+    @manage_iq_product.save\n+    respond_with @manage_iq_product\n+  end\n+\n+  api :PUT, '/products/:id', 'Updates product with :id'\n+  param :id, :number, required: true\n+  param :name, String, desc: 'Product Name'\n+  param :description, String, desc: 'Short description'\n+  param :service_catalog_id, Integer, desc: 'ManageIQ Catalog Id'\n+  param :service_type_id, Integer, desc: 'ManageIQ Catalog Item Id'\n+  param :chef_role, String, desc: 'Chef role'\n+  param :product_type_id, Integer, desc: 'ProductType Id'\n+  param :cloud_id, Integer, desc: 'Cloud Id'\n+  param :active, :bool, desc: 'Product is active and available in the marketplace'","path":"app/controllers/manage_iq_products_controller.rb","position":40,"original_position":40,"commit_id":"5d9da028fb43ed21f2655d5d808e04ebbaeae4f9","original_commit_id":"5d9da028fb43ed21f2655d5d808e04ebbaeae4f9","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [82/80]<br>Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-03-04T19:06:19Z","updated_at":"2015-03-04T19:06:19Z","html_url":"https://github.com/projectjellyfish/api/pull/312#discussion_r25802868","pull_request_url":"https://api.github.com/repos/projectjellyfish/api/pulls/312","_links":{"self":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/comments/25802868"},"html":{"href":"https://github.com/projectjellyfish/api/pull/312#discussion_r25802868"},"pull_request":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/312"}}},"pull_request":{"url":"https://api.github.com/repos/projectjellyfish/api/pulls/312","id":30479301,"html_url":"https://github.com/projectjellyfish/api/pull/312","diff_url":"https://github.com/projectjellyfish/api/pull/312.diff","patch_url":"https://github.com/projectjellyfish/api/pull/312.patch","issue_url":"https://api.github.com/repos/projectjellyfish/api/issues/312","number":312,"state":"open","locked":false,"title":"Refactor products to use polymorphic relationships","user":{"login":"brittballard","id":129564,"avatar_url":"https://avatars.githubusercontent.com/u/129564?v=3","gravatar_id":"","url":"https://api.github.com/users/brittballard","html_url":"https://github.com/brittballard","followers_url":"https://api.github.com/users/brittballard/followers","following_url":"https://api.github.com/users/brittballard/following{/other_user}","gists_url":"https://api.github.com/users/brittballard/gists{/gist_id}","starred_url":"https://api.github.com/users/brittballard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brittballard/subscriptions","organizations_url":"https://api.github.com/users/brittballard/orgs","repos_url":"https://api.github.com/users/brittballard/repos","events_url":"https://api.github.com/users/brittballard/events{/privacy}","received_events_url":"https://api.github.com/users/brittballard/received_events","type":"User","site_admin":false},"body":"* Broke out manage_iq_products\r\n* Broke out team_member_products\r\n* Moved provisioning logic into product\r\n* Added test coverage","created_at":"2015-03-04T16:18:19Z","updated_at":"2015-03-04T19:06:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba8419b8626f03df54e24c9164e08bfeabd8df5b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projectjellyfish/api/pulls/312/commits","review_comments_url":"https://api.github.com/repos/projectjellyfish/api/pulls/312/comments","review_comment_url":"https://api.github.com/repos/projectjellyfish/api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectjellyfish/api/issues/312/comments","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/5d9da028fb43ed21f2655d5d808e04ebbaeae4f9","head":{"label":"projectjellyfish:bb-product-mods","ref":"bb-product-mods","sha":"5d9da028fb43ed21f2655d5d808e04ebbaeae4f9","user":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"repo":{"id":25487089,"name":"api","full_name":"projectjellyfish/api","owner":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectjellyfish/api","description":"Project Jellyfish API","fork":false,"url":"https://api.github.com/repos/projectjellyfish/api","forks_url":"https://api.github.com/repos/projectjellyfish/api/forks","keys_url":"https://api.github.com/repos/projectjellyfish/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectjellyfish/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectjellyfish/api/teams","hooks_url":"https://api.github.com/repos/projectjellyfish/api/hooks","issue_events_url":"https://api.github.com/repos/projectjellyfish/api/issues/events{/number}","events_url":"https://api.github.com/repos/projectjellyfish/api/events","assignees_url":"https://api.github.com/repos/projectjellyfish/api/assignees{/user}","branches_url":"https://api.github.com/repos/projectjellyfish/api/branches{/branch}","tags_url":"https://api.github.com/repos/projectjellyfish/api/tags","blobs_url":"https://api.github.com/repos/projectjellyfish/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectjellyfish/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectjellyfish/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectjellyfish/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/{sha}","languages_url":"https://api.github.com/repos/projectjellyfish/api/languages","stargazers_url":"https://api.github.com/repos/projectjellyfish/api/stargazers","contributors_url":"https://api.github.com/repos/projectjellyfish/api/contributors","subscribers_url":"https://api.github.com/repos/projectjellyfish/api/subscribers","subscription_url":"https://api.github.com/repos/projectjellyfish/api/subscription","commits_url":"https://api.github.com/repos/projectjellyfish/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectjellyfish/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectjellyfish/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectjellyfish/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectjellyfish/api/contents/{+path}","compare_url":"https://api.github.com/repos/projectjellyfish/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectjellyfish/api/merges","archive_url":"https://api.github.com/repos/projectjellyfish/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectjellyfish/api/downloads","issues_url":"https://api.github.com/repos/projectjellyfish/api/issues{/number}","pulls_url":"https://api.github.com/repos/projectjellyfish/api/pulls{/number}","milestones_url":"https://api.github.com/repos/projectjellyfish/api/milestones{/number}","notifications_url":"https://api.github.com/repos/projectjellyfish/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectjellyfish/api/labels{/name}","releases_url":"https://api.github.com/repos/projectjellyfish/api/releases{/id}","created_at":"2014-10-20T21:17:09Z","updated_at":"2015-03-04T17:43:53Z","pushed_at":"2015-03-04T19:06:07Z","git_url":"git://github.com/projectjellyfish/api.git","ssh_url":"git@github.com:projectjellyfish/api.git","clone_url":"https://github.com/projectjellyfish/api.git","svn_url":"https://github.com/projectjellyfish/api","homepage":"","size":5624,"stargazers_count":16,"watchers_count":16,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":68,"forks":3,"open_issues":68,"watchers":16,"default_branch":"master"}},"base":{"label":"projectjellyfish:master","ref":"master","sha":"5d2b5ae6f9ac4f5260eb1aa3140ee192f59c0930","user":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"repo":{"id":25487089,"name":"api","full_name":"projectjellyfish/api","owner":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectjellyfish/api","description":"Project Jellyfish API","fork":false,"url":"https://api.github.com/repos/projectjellyfish/api","forks_url":"https://api.github.com/repos/projectjellyfish/api/forks","keys_url":"https://api.github.com/repos/projectjellyfish/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectjellyfish/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectjellyfish/api/teams","hooks_url":"https://api.github.com/repos/projectjellyfish/api/hooks","issue_events_url":"https://api.github.com/repos/projectjellyfish/api/issues/events{/number}","events_url":"https://api.github.com/repos/projectjellyfish/api/events","assignees_url":"https://api.github.com/repos/projectjellyfish/api/assignees{/user}","branches_url":"https://api.github.com/repos/projectjellyfish/api/branches{/branch}","tags_url":"https://api.github.com/repos/projectjellyfish/api/tags","blobs_url":"https://api.github.com/repos/projectjellyfish/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectjellyfish/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectjellyfish/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectjellyfish/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/{sha}","languages_url":"https://api.github.com/repos/projectjellyfish/api/languages","stargazers_url":"https://api.github.com/repos/projectjellyfish/api/stargazers","contributors_url":"https://api.github.com/repos/projectjellyfish/api/contributors","subscribers_url":"https://api.github.com/repos/projectjellyfish/api/subscribers","subscription_url":"https://api.github.com/repos/projectjellyfish/api/subscription","commits_url":"https://api.github.com/repos/projectjellyfish/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectjellyfish/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectjellyfish/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectjellyfish/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectjellyfish/api/contents/{+path}","compare_url":"https://api.github.com/repos/projectjellyfish/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectjellyfish/api/merges","archive_url":"https://api.github.com/repos/projectjellyfish/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectjellyfish/api/downloads","issues_url":"https://api.github.com/repos/projectjellyfish/api/issues{/number}","pulls_url":"https://api.github.com/repos/projectjellyfish/api/pulls{/number}","milestones_url":"https://api.github.com/repos/projectjellyfish/api/milestones{/number}","notifications_url":"https://api.github.com/repos/projectjellyfish/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectjellyfish/api/labels{/name}","releases_url":"https://api.github.com/repos/projectjellyfish/api/releases{/id}","created_at":"2014-10-20T21:17:09Z","updated_at":"2015-03-04T17:43:53Z","pushed_at":"2015-03-04T19:06:07Z","git_url":"git://github.com/projectjellyfish/api.git","ssh_url":"git@github.com:projectjellyfish/api.git","clone_url":"https://github.com/projectjellyfish/api.git","svn_url":"https://github.com/projectjellyfish/api","homepage":"","size":5624,"stargazers_count":16,"watchers_count":16,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":68,"forks":3,"open_issues":68,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/312"},"html":{"href":"https://github.com/projectjellyfish/api/pull/312"},"issue":{"href":"https://api.github.com/repos/projectjellyfish/api/issues/312"},"comments":{"href":"https://api.github.com/repos/projectjellyfish/api/issues/312/comments"},"review_comments":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/312/comments"},"review_comment":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/312/commits"},"statuses":{"href":"https://api.github.com/repos/projectjellyfish/api/statuses/5d9da028fb43ed21f2655d5d808e04ebbaeae4f9"}}}}