{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/373","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/373/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/373/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/373/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/pull/373","id":56263094,"number":373,"title":"storage: pass metadata during stream upload","user":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars.githubusercontent.com/u/723048?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/labels/cla:%20yes","name":"cla: yes","color":"009800"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/labels/storage","name":"storage","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-02T17:04:49Z","updated_at":"2015-02-02T19:26:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/pulls/373","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/pull/373","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-node/pull/373.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-node/pull/373.patch"},"body":"Fixes #368\r\n\r\nLooks like there are two concepts of metadata in an Object response ([seen here](https://cloud.google.com/storage/docs/json_api/v1/objects#resource)),\r\n\r\n1. metadata, such as `etag`, `selfLink`, `contentType`, `updated`, `kind`, `id`, etc.\r\n2. custom metadata, embedded within `metadata.metadata`\r\n\r\nThis PR fixes the way in which the insert API receives the request body from us , so that custom properties can be set as [we say they are](https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/lib/storage/bucket.js#L400) during a file upload.\r\n\r\nHowever, that would stop a user from specifying other, non-custom, metadata properties. Maybe we should just change the docs to say \"custom metadata properties go inside a `metadata` object\", e.g.\r\n\r\n```js\r\nvar options = {\r\n  metadata: {\r\n    contentType: 'content-type',\r\n    metadata: {\r\n      custom: 'metadata'\r\n    }\r\n  }\r\n}\r\n\r\nbucket.upload(\"/file/path.txt\", options, //...\r\n\r\nbucket.file(\"file.txt\").createWriteStream(options)\r\n```\r\n\r\nI'm talking myself out of thinking this PR is a good idea. Halp!"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/comments/72520370","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/pull/373#issuecomment-72520370","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/373","id":72520370,"user":{"login":"ryanseys","id":163873,"avatar_url":"https://avatars.githubusercontent.com/u/163873?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanseys","html_url":"https://github.com/ryanseys","followers_url":"https://api.github.com/users/ryanseys/followers","following_url":"https://api.github.com/users/ryanseys/following{/other_user}","gists_url":"https://api.github.com/users/ryanseys/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanseys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanseys/subscriptions","organizations_url":"https://api.github.com/users/ryanseys/orgs","repos_url":"https://api.github.com/users/ryanseys/repos","events_url":"https://api.github.com/users/ryanseys/events{/privacy}","received_events_url":"https://api.github.com/users/ryanseys/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T19:26:47Z","updated_at":"2015-02-02T19:26:47Z","body":"So wait, what other properties go on the same level as the outer metadata object as seen at https://github.com/GoogleCloudPlatform/gcloud-node/issues/368#issuecomment-72519661 ?"}}