{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/849","labels_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/849/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/849/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/849/events","html_url":"https://github.com/aws/aws-sdk-ruby/issues/849","id":89878448,"number":849,"title":"s3 object #copy_from raises ArgumentError: missing required parameter params[:copy_source]","user":{"login":"gregburek","id":423716,"avatar_url":"https://avatars.githubusercontent.com/u/423716?v=3","gravatar_id":"","url":"https://api.github.com/users/gregburek","html_url":"https://github.com/gregburek","followers_url":"https://api.github.com/users/gregburek/followers","following_url":"https://api.github.com/users/gregburek/following{/other_user}","gists_url":"https://api.github.com/users/gregburek/gists{/gist_id}","starred_url":"https://api.github.com/users/gregburek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregburek/subscriptions","organizations_url":"https://api.github.com/users/gregburek/orgs","repos_url":"https://api.github.com/users/gregburek/repos","events_url":"https://api.github.com/users/gregburek/events{/privacy}","received_events_url":"https://api.github.com/users/gregburek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-21T07:43:37Z","updated_at":"2015-06-22T22:46:58Z","closed_at":null,"body":"When using aws-sdk (2.1.0):\r\n\r\n```\r\ns3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])\r\nfirst = s3.bucket('example').object('source')\r\nsecond = s3.bucket('example').object('dest')\r\nsecond.copy_from(first)\r\nArgumentError: missing required parameter params[:copy_source]\r\nfrom /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.0/lib/aws-sdk-core/param_validator.rb:26:in `validate!'\r\n```\r\n\r\nBased on https://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#copy_from-instance_method, it appears that the case statement is against the `source`, not the `source.class`, which leads to an empty `:copy_source` param. \r\n\r\nManually setting `:copy_source` as the intended case branch does in the above link works:\r\n\r\n```\r\n>second.copy_from(first, copy_source: \"/#{first.bucket.name}/#{first.key}\")\r\n=> {\r\n    :copy_object_result => {\r\n                 :etag => \"\\\"0bdef96bff3e420d51cdaa2374f689a5\\\"\",\r\n        :last_modified => 2015-06-21 07:33:52 UTC\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/comments/114292021","html_url":"https://github.com/aws/aws-sdk-ruby/issues/849#issuecomment-114292021","issue_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/849","id":114292021,"user":{"login":"trevorrowe","id":27863,"avatar_url":"https://avatars.githubusercontent.com/u/27863?v=3","gravatar_id":"","url":"https://api.github.com/users/trevorrowe","html_url":"https://github.com/trevorrowe","followers_url":"https://api.github.com/users/trevorrowe/followers","following_url":"https://api.github.com/users/trevorrowe/following{/other_user}","gists_url":"https://api.github.com/users/trevorrowe/gists{/gist_id}","starred_url":"https://api.github.com/users/trevorrowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevorrowe/subscriptions","organizations_url":"https://api.github.com/users/trevorrowe/orgs","repos_url":"https://api.github.com/users/trevorrowe/repos","events_url":"https://api.github.com/users/trevorrowe/events{/privacy}","received_events_url":"https://api.github.com/users/trevorrowe/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T22:46:58Z","updated_at":"2015-06-22T22:46:58Z","body":"It appears you are linking to documentation for v1 of the `aws-sdk` gem but are using v2. The documentation for `#copy_from` in v2 can be found here:\r\n\r\nhttp://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Object.html#copy_from-instance_method\r\n\r\nYou should be able to invoke this like so:\r\n\r\n```ruby\r\ns3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])\r\ns3.bucket('example').object('dest').copy_from(copy_source: \"example/source\")\r\n```"}}