// 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.admanager.v1;

import "google/ads/admanager/v1/dai_encoding_profile_enums.proto";
import "google/ads/admanager/v1/size.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";

option csharp_namespace = "Google.Ads.AdManager.V1";
option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager";
option java_multiple_files = true;
option java_outer_classname = "DaiEncodingProfileMessagesProto";
option java_package = "com.google.ads.admanager.v1";
option php_namespace = "Google\\Ads\\AdManager\\V1";
option ruby_package = "Google::Ads::AdManager::V1";

// A DaiEncodingProfile contains data about a publisher's encoding profiles. Ad
// Manager Dynamic Ad Insertion (DAI) uses the profile information about the
// content to select an appropriate ad transcode to play for the particular
// video.
message DaiEncodingProfile {
  option (google.api.resource) = {
    type: "admanager.googleapis.com/DaiEncodingProfile"
    pattern: "networks/{network_code}/daiEncodingProfiles/{dai_encoding_profile}"
    plural: "daiEncodingProfiles"
    singular: "daiEncodingProfile"
  };

  // Identifier. The resource name of the `DaiEncodingProfile`.
  // Format:
  // `networks/{network_code}/daiEncodingProfiles/{dai_encoding_profile_id}`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Required. The name of the DaiEncodingProfile. It may be at most 64
  // characters. The name field can contain alphanumeric characters and symbols
  // other than the following: ", ', =, !, +, #, , ~, ;, ^, (, ), <, >, [, ],
  // the white space character.
  optional string display_name = 3 [(google.api.field_behavior) = REQUIRED];

  // Output only. The status of this DaiEncodingProfile.
  //
  // DAI encoding profiles are created in the
  // [DaiEncodingProfileStatus.ACTIVE][] state by default.
  //
  // Only active profiles will be allowed to be associated with live streams.
  optional DaiEncodingProfileStatusEnum.DaiEncodingProfileStatus status = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Required. The variant playlist type that this DaiEncodingProfile
  // represents.
  optional DaiEncodingProfileVariantTypeEnum.DaiEncodingProfileVariantType
      variant_type = 5 [(google.api.field_behavior) = REQUIRED];

  // Required. The digital container type of the underlying media. This is
  // required for MEDIA and IFRAME variant types.
  optional ContainerTypeEnum.ContainerType container_type = 6
      [(google.api.field_behavior) = REQUIRED];

  // Optional. Information about the video media, if present. This field will
  // only be set if the media contains video, or is an IFRAME variant type.
  VideoSettings video_settings = 7 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Information about the audio media, if present. This field will
  // only be set if the media contains audio. Only MEDIA and IFRAME variant
  // types can set audio.
  AudioSettings audio_settings = 8 [(google.api.field_behavior) = OPTIONAL];
}

// Information about the audio settings of an encoding profile.
message AudioSettings {
  // Required. The RFC6381 codec string of the audio.
  optional string codec = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The bitrate of the audio, in bits per second. This value must be
  // between 8kbps and 250 Mbps.
  optional int64 bitrate = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The number of audio channels, including low frequency channels.
  // This value has a maximum of 8.
  optional int64 channels = 3 [(google.api.field_behavior) = REQUIRED];

  // Required. The audio sample rate in hertz. Must be between 44kHz and 100kHz.
  optional int64 sample_rate_hertz = 4 [(google.api.field_behavior) = REQUIRED];
}

// Information about the video settings of an encoding profile.
message VideoSettings {
  // Required. The RFC6381 codec string of the video.
  optional string codec = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The bitrate of the video, in bits per second. This value must be
  // between 32kbps and 250 Mbps.
  optional int64 bitrate = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The frames per second of the video. This value will be truncated
  // to three decimal places.
  optional double frames_per_second = 3
      [(google.api.field_behavior) = REQUIRED];

  // Required. The resolution of the video, in pixels.
  optional Size resolution = 4 [(google.api.field_behavior) = REQUIRED];
}
