Skip to content

Instantly share code, notes, and snippets.

@ShivamGoyal1899
Created June 12, 2019 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShivamGoyal1899/0a5c68997caa5b0956f61c4a6f18f71e to your computer and use it in GitHub Desktop.
Save ShivamGoyal1899/0a5c68997caa5b0956f61c4a6f18f71e to your computer and use it in GitHub Desktop.
Future<BatchCreateMediaItemsResponse> createMediaItem(
String uploadToken, String albumId, String description) {
// Construct the request with the token, albumId and description.
final BatchCreateMediaItemsRequest request =
BatchCreateMediaItemsRequest.inAlbum(uploadToken, albumId, description);
// Make the API call to create the media item. The response contains a
// media item.
return client
.batchCreateMediaItems(request)
.then((BatchCreateMediaItemsResponse response) {
// Print and return the response.
print(response.newMediaItemResults[0].toJson());
return response;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment