/** * Uploads a channel banner image to YouTube. This method represents the first two steps in a * three-step process to update the banner image for a channel: * * - Call the channelBanners.insert method to upload the binary image data to YouTube. The image * must have a 16:9 aspect ratio and be at least 2120x1192 pixels. - Extract the url property's * value from the response that the API returns for step 1. - Call the channels.update method to * update the channel's branding settings. Set the brandingSettings.image.bannerExternalUrl * property's value to the URL obtained in step 2. * * Create a request for the method "channelBanners.insert". * * This request holds the parameters needed by the the youtube server. After setting any optional * parameters, call the {@link Insert#execute()} method to invoke the remote operation. <p> {@link * Insert#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * * @param content the {@link com.google.api.services.youtube.model.ChannelBannerResource} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Insert(com.google.api.services.youtube.model.ChannelBannerResource content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(YouTube.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.youtube.model.ChannelBannerResource.class); initializeMediaUpload(mediaContent); }
/** * Uploads a watermark image to YouTube and sets it for a channel. * * Create a request for the method "watermarks.set". * * This request holds the parameters needed by the the youtube server. After setting any optional * parameters, call the {@link Set#execute()} method to invoke the remote operation. <p> {@link * Set#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be * called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param channelId The channelId parameter specifies the YouTube channel ID for which the watermark is being provided. * @param content the {@link com.google.api.services.youtube.model.InvideoBranding} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Set(java.lang.String channelId, com.google.api.services.youtube.model.InvideoBranding content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(YouTube.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, Void.class); this.channelId = com.google.api.client.util.Preconditions.checkNotNull(channelId, "Required parameter channelId must be specified."); initializeMediaUpload(mediaContent); }
/** * Uploads a custom video thumbnail to YouTube and sets it for a video. * * Create a request for the method "thumbnails.set". * * This request holds the parameters needed by the the youtube server. After setting any optional * parameters, call the {@link Set#execute()} method to invoke the remote operation. <p> {@link * Set#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be * called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param videoId The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being * provided. * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Set(java.lang.String videoId, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(YouTube.this, "POST", "/upload/" + getServicePath() + REST_PATH, null, com.google.api.services.youtube.model.ThumbnailSetResponse.class); this.videoId = com.google.api.client.util.Preconditions.checkNotNull(videoId, "Required parameter videoId must be specified."); initializeMediaUpload(mediaContent); }
/** * Uploads a caption track. * * Create a request for the method "captions.insert". * * This request holds the parameters needed by the the youtube server. After setting any optional * parameters, call the {@link Insert#execute()} method to invoke the remote operation. <p> {@link * Insert#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param part The part parameter specifies the caption resource parts that the API response will include. Set the * parameter value to snippet. * @param content the {@link com.google.api.services.youtube.model.Caption} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Insert(java.lang.String part, com.google.api.services.youtube.model.Caption content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(YouTube.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.youtube.model.Caption.class); this.part = com.google.api.client.util.Preconditions.checkNotNull(part, "Required parameter part must be specified."); initializeMediaUpload(mediaContent); }
/** * Updates a caption track. When updating a caption track, you can change the track's draft * status, upload a new caption file for the track, or both. * * Create a request for the method "captions.update". * * This request holds the parameters needed by the the youtube server. After setting any optional * parameters, call the {@link Update#execute()} method to invoke the remote operation. <p> {@link * Update#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param part The part parameter serves two purposes in this operation. It identifies the properties that the * write operation will set as well as the properties that the API response will include. Set * the property value to snippet if you are updating the track's draft status. Otherwise, set * the property value to id. * @param content the {@link com.google.api.services.youtube.model.Caption} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Update(java.lang.String part, com.google.api.services.youtube.model.Caption content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(YouTube.this, "PUT", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.youtube.model.Caption.class); this.part = com.google.api.client.util.Preconditions.checkNotNull(part, "Required parameter part must be specified."); initializeMediaUpload(mediaContent); }
/** * Uploads a video to YouTube and optionally sets the video's metadata. * * Create a request for the method "videos.insert". * * This request holds the parameters needed by the the youtube server. After setting any optional * parameters, call the {@link Insert#execute()} method to invoke the remote operation. <p> {@link * Insert#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param part The part parameter serves two purposes in this operation. It identifies the properties that the * write operation will set as well as the properties that the API response will include. * Note that not all parts contain properties that can be set when inserting or updating a * video. For example, the statistics object encapsulates statistics that YouTube calculates * for a video and does not contain values that you can set or modify. If the parameter value * specifies a part that does not contain mutable values, that part will still be included in * the API response. * @param content the {@link com.google.api.services.youtube.model.Video} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Insert(java.lang.String part, com.google.api.services.youtube.model.Video content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(YouTube.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.youtube.model.Video.class); this.part = com.google.api.client.util.Preconditions.checkNotNull(part, "Required parameter part must be specified."); initializeMediaUpload(mediaContent); }