{"action":"created","comment":{"url":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/comments/227046890","pull_request_review_id":166998320,"id":227046890,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzA0Njg5MA==","diff_hunk":"@@ -0,0 +1,58 @@\n+component {\n+\n+  variables.service = 'translate';\n+\n+  public any function init(\n+      required any api,\n+      required struct settings\n+  ) {\n+      variables.api = arguments.api;\n+      return this;\n+  }\n+\n+  public any function translate(required string text, string sourceLang='es', string targetLang='en' ){\n+    var payload = {};\n+    payload[ 'SourceLanguageCode' ] = sourceLang;\n+    payload[ 'TargetLanguageCode'] = targetLang;\n+    payload[ 'Text' ] = text;\n+\n+    var apiResponse = apiCall( payload = serializeJSON(payload) );\n+    if ( apiResponse.statusCode == 200 ) {\n+      apiResponse[ 'data' ] = deserializeJSON(apiResponse.rawData).TranslatedText;\n+    }\n+    return apiResponse;\n+  }\n+\n+  public string function getHost(\n+      required string region\n+  ) {\n+      return variables.service & '.' & region & '.amazonaws.com';\n+  }\n+\n+  private any function apiCall(","path":"services/translate.cfc","position":32,"original_position":32,"commit_id":"2e8176e0b1c658e5c96f56e84fb8f7a7c249839e","original_commit_id":"2e8176e0b1c658e5c96f56e84fb8f7a7c249839e","user":{"login":"jcberquist","id":3498220,"node_id":"MDQ6VXNlcjM0OTgyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/3498220?v=4","gravatar_id":"","url":"https://api.github.com/users/jcberquist","html_url":"https://github.com/jcberquist","followers_url":"https://api.github.com/users/jcberquist/followers","following_url":"https://api.github.com/users/jcberquist/following{/other_user}","gists_url":"https://api.github.com/users/jcberquist/gists{/gist_id}","starred_url":"https://api.github.com/users/jcberquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcberquist/subscriptions","organizations_url":"https://api.github.com/users/jcberquist/orgs","repos_url":"https://api.github.com/users/jcberquist/repos","events_url":"https://api.github.com/users/jcberquist/events{/privacy}","received_events_url":"https://api.github.com/users/jcberquist/received_events","type":"User","site_admin":false},"body":"It looks to me like the translate API is structured similarly to the dynamodb API - there is only one action here, but, like the dynomodb API, everything is implemented using POST to the root API path. So I would prefer to see this method structured similarly to the `apiCall()` method in the `dynamodb.cfc`:  https://github.com/jcberquist/aws-cfml/blob/master/services/dynamodb.cfc#L415-L431 - I think the calls to `serializeJSON()` and `deserializeJSON()` could also be moved into `apiCall()`.","created_at":"2018-10-22T16:35:51Z","updated_at":"2018-10-22T16:49:51Z","html_url":"https://github.com/jcberquist/aws-cfml/pull/13#discussion_r227046890","pull_request_url":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/13","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/comments/227046890"},"html":{"href":"https://github.com/jcberquist/aws-cfml/pull/13#discussion_r227046890"},"pull_request":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/13","id":224649660,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NjQ5NjYw","html_url":"https://github.com/jcberquist/aws-cfml/pull/13","diff_url":"https://github.com/jcberquist/aws-cfml/pull/13.diff","patch_url":"https://github.com/jcberquist/aws-cfml/pull/13.patch","issue_url":"https://api.github.com/repos/jcberquist/aws-cfml/issues/13","number":13,"state":"open","locked":false,"title":"Add Amazon translate service","user":{"login":"davidsf","id":73978,"node_id":"MDQ6VXNlcjczOTc4","avatar_url":"https://avatars2.githubusercontent.com/u/73978?v=4","gravatar_id":"","url":"https://api.github.com/users/davidsf","html_url":"https://github.com/davidsf","followers_url":"https://api.github.com/users/davidsf/followers","following_url":"https://api.github.com/users/davidsf/following{/other_user}","gists_url":"https://api.github.com/users/davidsf/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsf/subscriptions","organizations_url":"https://api.github.com/users/davidsf/orgs","repos_url":"https://api.github.com/users/davidsf/repos","events_url":"https://api.github.com/users/davidsf/events{/privacy}","received_events_url":"https://api.github.com/users/davidsf/received_events","type":"User","site_admin":false},"body":"Add CFC for Amazon Translate Service.\r\n\r\nhttps://docs.aws.amazon.com/en_en/translate/latest/dg/what-is.html ","created_at":"2018-10-22T11:18:49Z","updated_at":"2018-10-22T16:49:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39814a80ce810da56dda5ea8d3c6c2f954a50b6f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/13/commits","review_comments_url":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/13/comments","review_comment_url":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jcberquist/aws-cfml/issues/13/comments","statuses_url":"https://api.github.com/repos/jcberquist/aws-cfml/statuses/2e8176e0b1c658e5c96f56e84fb8f7a7c249839e","head":{"label":"davidsf:add-translate-service","ref":"add-translate-service","sha":"2e8176e0b1c658e5c96f56e84fb8f7a7c249839e","user":{"login":"davidsf","id":73978,"node_id":"MDQ6VXNlcjczOTc4","avatar_url":"https://avatars2.githubusercontent.com/u/73978?v=4","gravatar_id":"","url":"https://api.github.com/users/davidsf","html_url":"https://github.com/davidsf","followers_url":"https://api.github.com/users/davidsf/followers","following_url":"https://api.github.com/users/davidsf/following{/other_user}","gists_url":"https://api.github.com/users/davidsf/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsf/subscriptions","organizations_url":"https://api.github.com/users/davidsf/orgs","repos_url":"https://api.github.com/users/davidsf/repos","events_url":"https://api.github.com/users/davidsf/events{/privacy}","received_events_url":"https://api.github.com/users/davidsf/received_events","type":"User","site_admin":false},"repo":{"id":154104632,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQxMDQ2MzI=","name":"aws-cfml","full_name":"davidsf/aws-cfml","private":false,"owner":{"login":"davidsf","id":73978,"node_id":"MDQ6VXNlcjczOTc4","avatar_url":"https://avatars2.githubusercontent.com/u/73978?v=4","gravatar_id":"","url":"https://api.github.com/users/davidsf","html_url":"https://github.com/davidsf","followers_url":"https://api.github.com/users/davidsf/followers","following_url":"https://api.github.com/users/davidsf/following{/other_user}","gists_url":"https://api.github.com/users/davidsf/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsf/subscriptions","organizations_url":"https://api.github.com/users/davidsf/orgs","repos_url":"https://api.github.com/users/davidsf/repos","events_url":"https://api.github.com/users/davidsf/events{/privacy}","received_events_url":"https://api.github.com/users/davidsf/received_events","type":"User","site_admin":false},"html_url":"https://github.com/davidsf/aws-cfml","description":"Lucee/ColdFusion library for interacting with the AWS S3 and AWS DynamoDB REST API's.","fork":true,"url":"https://api.github.com/repos/davidsf/aws-cfml","forks_url":"https://api.github.com/repos/davidsf/aws-cfml/forks","keys_url":"https://api.github.com/repos/davidsf/aws-cfml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidsf/aws-cfml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidsf/aws-cfml/teams","hooks_url":"https://api.github.com/repos/davidsf/aws-cfml/hooks","issue_events_url":"https://api.github.com/repos/davidsf/aws-cfml/issues/events{/number}","events_url":"https://api.github.com/repos/davidsf/aws-cfml/events","assignees_url":"https://api.github.com/repos/davidsf/aws-cfml/assignees{/user}","branches_url":"https://api.github.com/repos/davidsf/aws-cfml/branches{/branch}","tags_url":"https://api.github.com/repos/davidsf/aws-cfml/tags","blobs_url":"https://api.github.com/repos/davidsf/aws-cfml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidsf/aws-cfml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidsf/aws-cfml/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidsf/aws-cfml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidsf/aws-cfml/statuses/{sha}","languages_url":"https://api.github.com/repos/davidsf/aws-cfml/languages","stargazers_url":"https://api.github.com/repos/davidsf/aws-cfml/stargazers","contributors_url":"https://api.github.com/repos/davidsf/aws-cfml/contributors","subscribers_url":"https://api.github.com/repos/davidsf/aws-cfml/subscribers","subscription_url":"https://api.github.com/repos/davidsf/aws-cfml/subscription","commits_url":"https://api.github.com/repos/davidsf/aws-cfml/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidsf/aws-cfml/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidsf/aws-cfml/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidsf/aws-cfml/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidsf/aws-cfml/contents/{+path}","compare_url":"https://api.github.com/repos/davidsf/aws-cfml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidsf/aws-cfml/merges","archive_url":"https://api.github.com/repos/davidsf/aws-cfml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidsf/aws-cfml/downloads","issues_url":"https://api.github.com/repos/davidsf/aws-cfml/issues{/number}","pulls_url":"https://api.github.com/repos/davidsf/aws-cfml/pulls{/number}","milestones_url":"https://api.github.com/repos/davidsf/aws-cfml/milestones{/number}","notifications_url":"https://api.github.com/repos/davidsf/aws-cfml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidsf/aws-cfml/labels{/name}","releases_url":"https://api.github.com/repos/davidsf/aws-cfml/releases{/id}","deployments_url":"https://api.github.com/repos/davidsf/aws-cfml/deployments","created_at":"2018-10-22T07:43:37Z","updated_at":"2018-10-22T07:43:46Z","pushed_at":"2018-10-22T11:16:57Z","git_url":"git://github.com/davidsf/aws-cfml.git","ssh_url":"git@github.com:davidsf/aws-cfml.git","clone_url":"https://github.com/davidsf/aws-cfml.git","svn_url":"https://github.com/davidsf/aws-cfml","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":"ColdFusion","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jcberquist:master","ref":"master","sha":"a7344eb5bdf51df2f053814b7b89ee966d39c576","user":{"login":"jcberquist","id":3498220,"node_id":"MDQ6VXNlcjM0OTgyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/3498220?v=4","gravatar_id":"","url":"https://api.github.com/users/jcberquist","html_url":"https://github.com/jcberquist","followers_url":"https://api.github.com/users/jcberquist/followers","following_url":"https://api.github.com/users/jcberquist/following{/other_user}","gists_url":"https://api.github.com/users/jcberquist/gists{/gist_id}","starred_url":"https://api.github.com/users/jcberquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcberquist/subscriptions","organizations_url":"https://api.github.com/users/jcberquist/orgs","repos_url":"https://api.github.com/users/jcberquist/repos","events_url":"https://api.github.com/users/jcberquist/events{/privacy}","received_events_url":"https://api.github.com/users/jcberquist/received_events","type":"User","site_admin":false},"repo":{"id":45583861,"node_id":"MDEwOlJlcG9zaXRvcnk0NTU4Mzg2MQ==","name":"aws-cfml","full_name":"jcberquist/aws-cfml","private":false,"owner":{"login":"jcberquist","id":3498220,"node_id":"MDQ6VXNlcjM0OTgyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/3498220?v=4","gravatar_id":"","url":"https://api.github.com/users/jcberquist","html_url":"https://github.com/jcberquist","followers_url":"https://api.github.com/users/jcberquist/followers","following_url":"https://api.github.com/users/jcberquist/following{/other_user}","gists_url":"https://api.github.com/users/jcberquist/gists{/gist_id}","starred_url":"https://api.github.com/users/jcberquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcberquist/subscriptions","organizations_url":"https://api.github.com/users/jcberquist/orgs","repos_url":"https://api.github.com/users/jcberquist/repos","events_url":"https://api.github.com/users/jcberquist/events{/privacy}","received_events_url":"https://api.github.com/users/jcberquist/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jcberquist/aws-cfml","description":"Lucee/ColdFusion library for interacting with the AWS S3 and AWS DynamoDB REST API's.","fork":false,"url":"https://api.github.com/repos/jcberquist/aws-cfml","forks_url":"https://api.github.com/repos/jcberquist/aws-cfml/forks","keys_url":"https://api.github.com/repos/jcberquist/aws-cfml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcberquist/aws-cfml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcberquist/aws-cfml/teams","hooks_url":"https://api.github.com/repos/jcberquist/aws-cfml/hooks","issue_events_url":"https://api.github.com/repos/jcberquist/aws-cfml/issues/events{/number}","events_url":"https://api.github.com/repos/jcberquist/aws-cfml/events","assignees_url":"https://api.github.com/repos/jcberquist/aws-cfml/assignees{/user}","branches_url":"https://api.github.com/repos/jcberquist/aws-cfml/branches{/branch}","tags_url":"https://api.github.com/repos/jcberquist/aws-cfml/tags","blobs_url":"https://api.github.com/repos/jcberquist/aws-cfml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcberquist/aws-cfml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcberquist/aws-cfml/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcberquist/aws-cfml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcberquist/aws-cfml/statuses/{sha}","languages_url":"https://api.github.com/repos/jcberquist/aws-cfml/languages","stargazers_url":"https://api.github.com/repos/jcberquist/aws-cfml/stargazers","contributors_url":"https://api.github.com/repos/jcberquist/aws-cfml/contributors","subscribers_url":"https://api.github.com/repos/jcberquist/aws-cfml/subscribers","subscription_url":"https://api.github.com/repos/jcberquist/aws-cfml/subscription","commits_url":"https://api.github.com/repos/jcberquist/aws-cfml/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcberquist/aws-cfml/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcberquist/aws-cfml/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcberquist/aws-cfml/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcberquist/aws-cfml/contents/{+path}","compare_url":"https://api.github.com/repos/jcberquist/aws-cfml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcberquist/aws-cfml/merges","archive_url":"https://api.github.com/repos/jcberquist/aws-cfml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcberquist/aws-cfml/downloads","issues_url":"https://api.github.com/repos/jcberquist/aws-cfml/issues{/number}","pulls_url":"https://api.github.com/repos/jcberquist/aws-cfml/pulls{/number}","milestones_url":"https://api.github.com/repos/jcberquist/aws-cfml/milestones{/number}","notifications_url":"https://api.github.com/repos/jcberquist/aws-cfml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcberquist/aws-cfml/labels{/name}","releases_url":"https://api.github.com/repos/jcberquist/aws-cfml/releases{/id}","deployments_url":"https://api.github.com/repos/jcberquist/aws-cfml/deployments","created_at":"2015-11-05T03:06:09Z","updated_at":"2018-10-04T19:24:37Z","pushed_at":"2018-10-22T11:18:50Z","git_url":"git://github.com/jcberquist/aws-cfml.git","ssh_url":"git@github.com:jcberquist/aws-cfml.git","clone_url":"https://github.com/jcberquist/aws-cfml.git","svn_url":"https://github.com/jcberquist/aws-cfml","homepage":null,"size":56,"stargazers_count":25,"watchers_count":25,"language":"ColdFusion","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":8,"open_issues":7,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/13"},"html":{"href":"https://github.com/jcberquist/aws-cfml/pull/13"},"issue":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/issues/13"},"comments":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/jcberquist/aws-cfml/statuses/2e8176e0b1c658e5c96f56e84fb8f7a7c249839e"}},"author_association":"NONE"}}
{"actor":{"display_login":"jcberquist"}}