syntax = "proto3";

package google.maps.weather.v1;

import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";
import "google/type/localized_text.proto";

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

// Represents a link to a data source.
// (-- api-linter: core::0123::resource-annotation=disabled
//     aip.dev/not-precedent: DataSource is not an AIP resource message;
//     name represents the official publisher name. --)
message DataSource {
  // The publisher of the alert.
  enum Publisher {
    // Publisher unspecified.
    PUBLISHER_UNSPECIFIED = 0;
    // Australia Australian Capital Territory
    AUSTRALIA_ACT_ESA = 1;
    // New South Wales
    AUSTRALIA_NSW_RFS = 2;
    // Queensland
    AUSTRALIA_QLD_QFES = 3;
    // South Australia
    AUSTRALIA_SA_CFS = 4;
    // Meteoalarm / EUMETNET Austria
    METEO_ALARM_AT = 5;
    // Bosnia
    METEO_ALARM_BS = 6;
    // Disaster Agency in Brazil
    BRAZIL_CENAD = 7;
    // Meteorological Agency in Brazil
    BRAZIL_INMET = 8;
    reserved 9;
    // Bulgaria
    METEO_ALARM_BG = 10;
    // Croatia
    METEO_ALARM_CR = 11;
    // Cyprus
    METEO_ALARM_CY = 12;
    // Czechia
    METEO_ALARM_CS = 13;
    // Denmark
    METEO_ALARM_DK = 14;
    // Ecuador
    EC_INAMHI = 15;
    // Finland
    METEO_ALARM_FI = 16;
    // France
    METEO_ALARM_FR = 17;
    // Germany
    DE_DWD = 18;
    // Great Britain
    METEO_ALARM_GB = 19;
    // Greece
    METEO_ALARM_GR = 20;
    // Hungary
    METEO_ALARM_HU = 21;
    // Iceland
    METEO_ALARM_IS = 22;
    // Ireland
    METEO_ALARM_IE = 23;
    // Italy
    METEO_ALARM_IT = 24;
    // Jamaica
    JM_JMS = 25;
    // Japan
    JMA = 26;
    // Netherlands
    METEO_ALARM_NL = 27;
    // Latvia
    METEO_ALARM_LV = 28;
    // Lithuania
    METEO_ALARM_LT = 29;
    // Luxembourg
    METEO_ALARM_LU = 30;
    // Mexico CIRES
    MEXICO_CIRES = 31;
    // New Zealand GeoNet
    NZ_GEONET = 32;
    // MetService
    NZ_NMS = 33;
    // North Macedonia
    METEO_ALARM_MK = 34;
    // Norway
    METEO_ALARM_NO = 35;
    // Philippines
    PHILIPPINES_PAGASA = 36;
    // Poland
    METEO_ALARM_PL = 37;
    // Portugal
    METEO_ALARM_PT = 38;
    // Romania
    METEO_ALARM_RO = 39;
    // Serbia
    METEO_ALARM_RS = 40;
    // Singapore
    SG_MSS = 41;
    // Slovakia
    METEO_ALARM_SK = 42;
    // Slovenia
    METEO_ALARM_SI = 43;
    // Solomon Islands
    SB_MET = 44;
    // Spain
    METEO_ALARM_ES = 45;
    // Sweden
    METEO_ALARM_SE = 46;
    // Switzerland
    METEO_ALARM_CH = 47;
    // Taiwan
    TAIWAN_NCDR = 48;
    // NOAA
    NOAA = 49;
    // National Tsunami Warning Center
    WCATWC = 50;
  }

  // The publisher of the alert.
  // (-- aip.dev/not-precedent: Field type changed to nested enum per atomic
  //     transition strategy. Wire-compatible; external consumers
  //     rely exclusively on HTTP REST/JSON where enum strings remain identical.
  //     --)
  Publisher publisher = 1 [(google.api.field_behavior) = OPTIONAL];

  // Official publisher name. Please note that while this field should be
  // localized, it is not guaranteed that it will be.
  string name = 2;

  // The URL of the authority's website.
  string authority_uri = 3;
}

// Represents a safety recommendation.
message SafetyRecommendation {
  // A directive to the user. Please note that while this field should be
  // localized, it is not guaranteed that it will be.
  string directive = 1;

  // An optional subtext for the directive, which may contain additional
  // context for the user. Please note that while this field should be
  // localized, it is not guaranteed that it will be.
  optional string subtext = 2;
}

// Represents the public weather alerts.
message PublicAlerts {
  // The unique identifier for this alert.
  string alert_id = 1;

  // The localized title for the alert.
  google.type.LocalizedText alert_title = 2;

  // The type of the weather event.
  enum EventType {
    // Unspecified weather event type.
    EVENT_TYPE_UNSPECIFIED = 0;
    // Acid rain event.
    ACID_RAIN = 1;
    // Aftershock event.
    AFTERSHOCK = 2;
    // Avalanche event.
    AVALANCHE = 3;
    // Blizzard event.
    BLIZZARD = 4;
    // Blowing snow event.
    BLOWING_SNOW = 5;
    // Bushfire event.
    BUSHFIRE = 6;
    // Coastal flood event.
    COASTAL_FLOOD = 7;
    // Coastal hazard event.
    COASTAL_HAZARD = 8;
    // Cold event.
    COLD = 9;
    // Cyclone event.
    CYCLONE = 10;
    // Drought event.
    DROUGHT = 11;
    // Dust storm event.
    DUST_STORM = 12;
    // Earthquake event.
    EARTHQUAKE = 13;
    // Extra tropical cyclone event.
    EXTRATROPICAL_CYCLONE = 14;
    // Fire event.
    FIRE = 15;
    // Fire weather event.
    FIRE_WEATHER = 16;
    // Flash flood event.
    FLASH_FLOOD = 17;
    // Flood event.
    FLOOD = 18;
    // Fog event.
    FOG = 19;
    // Freezing event.
    FREEZING = 20;
    // Freezing air temperature event.
    FREEZING_AIR_TEMPERATURE = 21;
    // Freezing drizzle event.
    FREEZING_DRIZZLE = 22;
    // Freezing rain event.
    FREEZING_RAIN_EVENT = 23;
    // Frost event.
    FROST = 24;
    // Gale event.
    GALE = 25;
    // Glaze event.
    GLAZE = 26;
    // Hail event.
    HAIL = 27;
    // Hazardous seas event.
    HAZARDOUS_SEAS = 28;
    // Heat event.
    HEAT = 29;
    // Humidity event.
    HUMIDITY = 30;
    // Hurricane event.
    HURRICANE = 31;
    // Ice storm event.
    ICE_STORM = 32;
    // Industrial fire event.
    INDUSTRIAL_FIRE = 33;
    // Lake effect snow event.
    LAKE_EFFECT_SNOW = 34;
    // Landslide event.
    LANDSLIDE = 35;
    // Monsoon event.
    MONSOON = 36;
    // Muddy flood event.
    MUDDY_FLOOD = 37;
    // Outflow event.
    OUTFLOW = 38;
    // Radiation event.
    RADIATION = 39;
    // Rain event.
    RAIN_EVENT = 40;
    // River flooding event.
    RIVER_FLOODING = 41;
    // Severe thunderstorm warning event.
    SEVERE_THUNDERSTORM_WARNING = 42;
    // Snowsquall event.
    SNOWSQUALL = 43;
    // Snow event.
    SNOW_EVENT = 44;
    // Storm event.
    STORM = 45;
    // Storm surge event.
    STORM_SURGE = 46;
    // Thunder event.
    THUNDER = 47;
    // Thunderstorm event.
    THUNDERSTORM = 48;
    // Tornado event.
    TORNADO = 49;
    // Tornado warning event.
    TORNADO_WARNING = 50;
    // Tropical cyclone event.
    TROPICAL_CYCLONE = 51;
    // Tropical cyclone warnings and watches event.
    TROPICAL_CYCLONE_WARNINGS_AND_WATCHES = 52;
    // Tropical disturbance event.
    TROPICAL_DISTURBANCE = 53;
    // Tropical storm event.
    TROPICAL_STORM = 54;
    // Tsunami event.
    TSUNAMI = 55;
    // Typhoon event.
    TYPHOON = 56;
    // Volcanic ash event.
    VOLCANIC_ASH = 57;
    // Volcanic eruption event.
    VOLCANIC_ERUPTION = 58;
    // Wildfire event.
    WILDFIRE = 59;
    // Wind event.
    WIND = 60;
    // Wind chill event.
    WIND_CHILL = 61;
    // Wind wave event.
    WIND_WAVE = 62;
    // Winter storm event.
    WINTER_STORM = 63;
  }
  // The type of weather event.
  // (-- aip.dev/not-precedent: Field type changed to nested enum per atomic
  //     transition strategy. Wire-compatible; external consumers
  //     rely exclusively on HTTP REST/JSON where enum strings remain identical.
  //     --)
  EventType event_type = 3 [(google.api.field_behavior) = OPTIONAL];

  // The name of the area where the alert is issued.
  // (-- api-linter: core::0122::name-suffix=disabled
  //     aip.dev/not-precedent: We need to use the _name suffix
  //     to be consistent with the rest of the API. --)
  string area_name = 4;

  // A GeoJSON representation of the areas where the alert is issued.
  //
  // The GeoJSON data must be in RFC 7946 format and represent either a
  // Polygon (for a single contiguous area) or a MultiPolygon (for multiple
  // distinct areas).
  //
  // Example:
  //
  // {
  //  "type": "Polygon",
  //   "coordinates": [
  //       [
  //           [-1, -1], [-1, 0], [0, 0], [-1, -1]
  //       ]
  //   ]
  // }
  //
  // A sample MultiPolygon GeoJson string looks like:
  //
  // {
  //  "type": "MultiPolygon",
  //   "coordinates": [
  //       [
  //           [0, 0], [-1, 0], [-1, 1], [0, 0]
  //       ],
  //       [
  //           [0, 0], [-2, 0], [-2, 2], [0, 0]
  //       ]
  //   ]
  // }
  optional string polygon = 5;

  // The latest text describing the alert as issued by the official authority.
  // Please note that while this field should be localized, it is not guaranteed
  // that it will be.
  optional string description = 6;

  // The code denoting the severity of the subject event of the alert message.
  enum Severity {
    // Severity not known.
    SEVERITY_UNKNOWN = 0;
    // Extraordinary threat to life or property.
    EXTREME = 1;
    // Significant threat to life or property.
    SEVERE = 2;
    // Possible threat to life or property.
    MODERATE = 3;
    // Minor threat to life or property.
    MINOR = 4;
  }
  // The severity level of the alert.
  // (-- aip.dev/not-precedent: Field type changed to nested enum per atomic
  //     transition strategy. Wire-compatible; external consumers
  //     rely exclusively on HTTP REST/JSON where enum strings remain identical.
  //     --)
  optional Severity severity = 7 [(google.api.field_behavior) = OPTIONAL];

  // The code denoting the certainty of the subject event of the alert message.
  enum Certainty {
    // Certainty not known.
    CERTAINTY_UNKNOWN = 0;
    // Determined to have occurred or to be ongoing.
    OBSERVED = 1;
    // Very likely.
    VERY_LIKELY = 2;
    // Likely (p > ~50%).
    LIKELY = 3;
    // Possible but not likely (p <= ~50%).
    POSSIBLE = 4;
    // Unlikely (p ~ 0%).
    UNLIKELY = 5;
  }
  // The certainty of the alert.
  // (-- aip.dev/not-precedent: Field type changed to nested enum per atomic
  //     transition strategy. Wire-compatible; external consumers
  //     rely exclusively on HTTP REST/JSON where enum strings remain identical.
  //     --)
  optional Certainty certainty = 8 [(google.api.field_behavior) = OPTIONAL];

  // The code denoting the urgency of the subject event of the alert message.
  enum Urgency {
    // Urgency not known.
    URGENCY_UNKNOWN = 0;
    // Responsive action SHOULD be taken immediately.
    IMMEDIATE = 1;
    // Responsive action SHOULD be taken soon (within next hour).
    EXPECTED = 2;
    // Responsive action SHOULD be taken in the near future.
    FUTURE = 3;
    // Responsive action is no longer required.
    PAST = 4;
  }
  // The urgency of the alert.
  // (-- aip.dev/not-precedent: Field type changed to nested enum per atomic
  //     transition strategy. Wire-compatible; external consumers
  //     rely exclusively on HTTP REST/JSON where enum strings remain identical.
  //     --)
  optional Urgency urgency = 9 [(google.api.field_behavior) = OPTIONAL];

  // Instructions recommended by the publisher. Please note that while this
  // field should be localized, it is not guaranteed that it will be.
  repeated string instruction = 10;

  // Safety recommendations directive to the user, these can be provided by the
  // publisher or other authorities.
  repeated SafetyRecommendation safety_recommendations = 11;

  // The time zone offset from UTC for the location of the alert.
  // The value is formatted as a string ending in 's', e.g., "-14400s" for 4
  // hours behind UTC.
  string timezone_offset = 12;

  // The start time of the event.
  google.protobuf.Timestamp start_time = 13;

  // The expiration time of the event.
  google.protobuf.Timestamp expiration_time = 14;

  // Details of the publisher that issued the alert.
  DataSource data_source = 15;
}
