ruby/example_code/s3/s3-ruby-example-set-item-props.rb
# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.

Full example call:
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Full example call : Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .
def run_me
  source_object_path = 'doc-example-bucket/my-file.txt'
  target_bucket_name = 'doc-example-bucket1'
  target_object_path = 'copied-files/my-copied-file.txt'
  canned_acl = 'bucket-owner-read'
  storage_class = 'STANDARD_IA'
  region = 'us-west-2'
  s3_client = Aws::S3::Client.new(region: region)
  if object_copied_with_additional_properties?(
    s3_client,
    source_object_path,
    target_bucket_name,
    target_object_path,
    canned_acl,
    storage_class
  )
    puts "Object copied from '#{source_object_path}' to " \
      "'#{target_bucket_name}/#{target_object_path}'."
  else
    puts "Object '#{source_object_path}' not copied to " \
      "'#{target_bucket_name}/#{target_object_path}'."
  end
end
def run_me source_object_path = 'doc-example-bucket/my-file.txt' target_bucket_name = 'doc-example-bucket1' target_object_path = 'copied-files/my-copied-file.txt' canned_acl = 'bucket-owner-read' storage_class = 'STANDARD_IA' region = 'us-west-2' s3_client = Aws :: S3 :: Client . new ( region : region ) if object_copied_with_additional_properties? ( s3_client , source_object_path , target_bucket_name , target_object_path , canned_acl , storage_class ) puts "Object copied from '#{source_object_path}' to " "'#{target_bucket_name}/#{target_object_path}'." else puts "Object '#{source_object_path}' not copied to " "'#{target_bucket_name}/#{target_object_path}'." end end
Full example call:
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Full example call : Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .