// Copyright 2025 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.maps.weather.v1;

import "google/maps/weather/v1/precipitation.proto";
import "google/type/interval.proto";

option csharp_namespace = "Google.Geo.Weather.V1";
option go_package = "cloud.google.com/go/maps/weather/apiv1/weatherpb;weatherpb";
option java_multiple_files = true;
option java_outer_classname = "ForecastMinuteProto";
option java_package = "com.google.maps.weather.v1";
option objc_class_prefix = "GMWV1";
option php_namespace = "Google\\Geo\\Weather\\V1";

// Represents a segment of precipitation forecast data.
message PrecipitationSegment {
  // The type of precipitation.
  enum DominantPrecipitationType {
    // Unspecified precipitation type.
    DOMINANT_PRECIPITATION_TYPE_UNSPECIFIED = 0;

    // No precipitation.
    NONE = 1;

    // Rain.
    RAIN = 2;

    // Snow.
    SNOW = 3;

    // Hail.
    HAIL = 4;
  }

  // Precipitation intensity of the segment.
  enum PrecipitationIntensity {
    // Unknown precipitation intensity.
    PRECIPITATION_INTENSITY_UNSPECIFIED = 0;

    // No precipitation intensity.
    NO_INTENSITY = 1;

    // Light precipitation intensity.
    LIGHT = 2;

    // Moderate precipitation intensity.
    MODERATE = 3;

    // Heavy precipitation intensity.
    HEAVY = 4;
  }

  // The timeframe relevant to the segment.
  google.type.Interval time_frame = 1;

  // The type of precipitation.
  DominantPrecipitationType type = 2;

  // The chance of precipitation.
  // Values are in percentages ranging from 0 to 100.
  int32 probability = 3;

  // Quantitative precipitation forecast
  QuantitativePrecipitationForecast qpf = 4;

  // Snow quantitative precipitation forecast
  QuantitativePrecipitationForecast snowfall_amount = 5;

  // Precipitation intensity of the segment.
  PrecipitationIntensity intensity = 6;
}

// Contains high resolution forecast data for precipitation events.
message PrecipitationEvent {
  // The localized title for the nowcast prediction event.
  string title = 1;

  // The localized subtitle for the nowcast prediction event.
  string subtitle = 2;

  // The timeframe relevant to the event and the textual representations (title
  // and sub title).
  google.type.Interval time_frame = 3;

  // The precipitation intervals in minutes resolution.
  repeated PrecipitationsInterval intervals = 4;
}

// Represents a single interval of high resolution Precipitations forecast data.
message PrecipitationsInterval {
  // The type of precipitation associated with the precipitation event.
  enum PrecipitationIntervalType {
    // Unspecified precipitation interval type.
    PRECIPITATION_INTERVAL_TYPE_UNSPECIFIED = 0;

    // No precipitation.
    NO_PRECIPITATION = 1;

    // Snow precipitation.
    SNOW = 2;

    // Rain precipitation.
    RAIN = 3;

    // Light rain precipitation.
    LIGHT_RAIN = 4;

    // Heavy rain precipitation.
    HEAVY_RAIN = 5;

    // Both rain and snow precipitations.
    RAIN_AND_SNOW = 6;

    // Sleet precipitation.
    SLEET = 7;

    // Freezing rain precipitation.
    FREEZING_RAIN = 8;

    // Hail precipitation.
    HAIL = 9;
  }

  // Precipitation intensity of the interval.
  enum IntervalPrecipitationIntensity {
    // Unknown precipitation intensity.
    INTERVAL_PRECIPITATION_INTENSITY_UNSPECIFIED = 0;

    // No precipitation.
    NO_INTENSITY = 1;

    // Light precipitation.
    LIGHT = 2;

    // Moderate precipitation.
    MODERATE = 3;

    // Heavy precipitation.
    HEAVY = 4;
  }

  // The timeframe of the precipitation interval.
  google.type.Interval time_frame = 1;

  // The type of precipitation associated with the precipitation event.
  PrecipitationIntervalType type = 2;

  // The chance of `precipitation_type` for the interval.
  //
  // Values are in percentages ranging from 0 to 100.
  int32 probability = 3;

  // Quantitative precipitation forecast for the precipitation interval.
  //
  // Values are in either inches or millimeters.
  QuantitativePrecipitationForecast qpf = 4;

  // Snow quantitative precipitation forecast for the precipitation interval.
  //
  // Values are in either inches or millimeters.
  QuantitativePrecipitationForecast snow_qpf = 5;

  // Precipitation intensity of the interval.
  IntervalPrecipitationIntensity intensity = 6;
}
