서비스 알림 예시

컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.

다음은 ASCII로 표현한 서비스 알림 피드의 예입니다. 이 예에서는 16230번 정류장을 통과하는 모든 이동과 219번 경로에 속하고 16130번 정류장을 경유하는 이동에 알림이 적용됩니다.

서비스 알림 피드를 구성하는 방법에 대해 자세히 알아보려면 알림 개요를 읽어보세요.

# header information
header {
  # version of speed specification. Currently "2.0".
  gtfs_realtime_version: "2.0"

  # DIFFERENTIAL is unsupported. use FULL_DATASET only
  incrementality: FULL_DATASET

  # the moment where this dataset was generated on the server
  timestamp: 1658283241
}
# multiple entities can be included in the feed
entity {
  # unique identifier for the entity within the feed
  id: "0"

  # "type" of the entity
  alert {
    # multiple periods can be defined. active_period defines
    # the time period that the alert is applied to the selectors
    active_period {
      # either start time or end time must be present
      # one of them can be omitted but not both
      # start time in seconds after epoch
      start: 1658283241
      # end time in seconds after epoch
      end: 1658293845
    }

    # multiple selectors can be given to select the affected entities
    # selectors are applied with a logical OR relationship across
    # informed_entity messages along with a logical AND relationship
    # for parameters in each informed_entity
    informed_entity {
      # valid parameters:
      # agency_id, route_id, route_type, direction_id, stop_id, trip
      route_id: "219"
      stop_id: "16130"
    }
    informed_entity {
      stop_id: "16230"
    }

    # system may use the cause and effect to judge the alert severity
    # see https://support.google.com/transitpartners/answer/10104458
    # cause of the alert - see gtfs-realtime.proto for valid values
    cause: CONSTRUCTION
    # effect of the alert - see gtfs-realtime.proto for valid values
    effect: DETOUR

    # the given url provides additional information
    url {
      # multiple languages/translations supported
      translation {
        # the link points to a webpage with more details of the alert
        text: "http://www.sometransitagency/alerts"
        # language code must be BCP-47, if defined
        language: "en"
      }
    }

    # header of the alert
    header_text {
      # multiple languages/translations supported
      translation {
        text: "Stop at Elm street is closed, temporary stop at Oak street"
        language: "en"
      }
    }

    # alert description. additional info to the header text
    description_text {
      # multiple languages/translations supported
      translation {
        text: "Due to construction at Elm street the stop is closed. The temporary stop can be found 300 meters north at Oak street"
        language: "en"
      }
    }
  }
}