// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.ads.googleads.v24.services;

import "google/ads/googleads/v24/resources/youtube_video_upload.proto";
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Ads.GoogleAds.V24.Services";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v24/services;services";
option java_multiple_files = true;
option java_outer_classname = "YoutubeVideoUploadServiceProto";
option java_package = "com.google.ads.googleads.v24.services";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V24\\Services";
option ruby_package = "Google::Ads::GoogleAds::V24::Services";

// Proto file describing the YouTubeVideoUpload service.

// Service to manage YouTube video uploads.
service YouTubeVideoUploadService {
  option (google.api.default_host) = "googleads.googleapis.com";
  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";

  // Uploads a video to Google-managed or advertiser owned (brand) YouTube
  // channel.
  rpc CreateYouTubeVideoUpload(CreateYouTubeVideoUploadRequest)
      returns (CreateYouTubeVideoUploadResponse) {
    option (google.api.http) = {
      post: "/v24/customers/{customer_id=*}/youTubeVideoUploads:create"
      body: "*"
    };
    option (google.api.method_signature) = "customer_id,you_tube_video_upload";
  }

  // Updates YouTube video's metadata, but only for videos uploaded using this
  // API.
  rpc UpdateYouTubeVideoUpload(UpdateYouTubeVideoUploadRequest)
      returns (UpdateYouTubeVideoUploadResponse) {
    option (google.api.http) = {
      post: "/v24/customers/{customer_id=*}/youTubeVideoUploads:update"
      body: "*"
    };
    option (google.api.method_signature) =
        "customer_id,you_tube_video_upload,update_mask";
  }

  // Removes YouTube videos uploaded using this API.
  rpc RemoveYouTubeVideoUpload(RemoveYouTubeVideoUploadRequest)
      returns (RemoveYouTubeVideoUploadResponse) {
    option (google.api.http) = {
      post: "/v24/customers/{customer_id=*}/youTubeVideoUploads:remove"
      body: "*"
    };
    option (google.api.method_signature) = "customer_id";
  }
}

// Request message for
// [YouTubeVideoUploadService.CreateYouTubeVideoUpload][google.ads.googleads.v24.services.YouTubeVideoUploadService.CreateYouTubeVideoUpload].
message CreateYouTubeVideoUploadRequest {
  // Required. The customer ID requesting the upload. Required.
  string customer_id = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The initial details of the video to upload. Required.
  google.ads.googleads.v24.resources.YouTubeVideoUpload you_tube_video_upload =
      2 [(google.api.field_behavior) = REQUIRED];
}

// Response message for
// [YouTubeVideoUploadService.CreateYouTubeVideoUpload][google.ads.googleads.v24.services.YouTubeVideoUploadService.CreateYouTubeVideoUpload].
message CreateYouTubeVideoUploadResponse {
  // The resource name of the successfully created YouTube video upload.
  string resource_name = 1 [(google.api.resource_reference) = {
    type: "googleads.googleapis.com/YouTubeVideoUpload"
  }];
}

// Request message for
// [YouTubeVideoUploadService.UpdateYouTubeVideoUpload][google.ads.googleads.v24.services.YouTubeVideoUploadService.UpdateYouTubeVideoUpload].
message UpdateYouTubeVideoUploadRequest {
  // Required. The customer ID requesting the YouTube video upload update.
  // Required.
  string customer_id = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The YouTube video upload resource to be updated. It's expected to
  // have a valid resource name. Required.
  google.ads.googleads.v24.resources.YouTubeVideoUpload you_tube_video_upload =
      2 [(google.api.field_behavior) = REQUIRED];

  // Required. FieldMask that determines which resource fields are modified in
  // an update.
  google.protobuf.FieldMask update_mask = 3
      [(google.api.field_behavior) = REQUIRED];
}

// Response message for
// [YouTubeVideoUploadService.UpdateYouTubeVideoUpload][google.ads.googleads.v24.services.YouTubeVideoUploadService.UpdateYouTubeVideoUpload].
message UpdateYouTubeVideoUploadResponse {
  // The resource name of the successfully updated YouTube video upload.
  string resource_name = 1 [(google.api.resource_reference) = {
    type: "googleads.googleapis.com/YouTubeVideoUpload"
  }];
}

// Request message for
// [YouTubeVideoUploadService.RemoveYouTubeVideoUpload][google.ads.googleads.v24.services.YouTubeVideoUploadService.RemoveYouTubeVideoUpload].
message RemoveYouTubeVideoUploadRequest {
  // Required. The customer ID requesting the YouTube video upload deletion.
  // Required.
  string customer_id = 1 [(google.api.field_behavior) = REQUIRED];

  // The resource names of the YouTube video uploads to be removed. Required.
  repeated string resource_names = 2;
}

// Response message for
// [YouTubeVideoUploadService.RemoveYouTubeVideoUpload][google.ads.googleads.v24.services.YouTubeVideoUploadService.RemoveYouTubeVideoUpload].
message RemoveYouTubeVideoUploadResponse {
  // The resource names of the successfully removed YouTube video uploads.
  repeated string resource_names = 1;
}
