空闲状态 Feed

定义

GolfAvailabilityFeed 定义

message GolfAvailabilityFeed {
  option features.(pb.java).nest_in_file_class = YES;

  repeated GolfAvailability data = 1;

}

GolfAvailability 定义

// It can be a tee time for a golf course entity.
// The availability feed should be a list of this message.
message GolfAvailability {
  option features.(pb.java).nest_in_file_class = YES;

  // An opaque string generated by the partner that identifies a tee time slot.
  // Must be unique across all entities and tee time slots.
  // Strongly recommended to only include URL-safe characters.
  // Required.
  string availability_id = 10 [features.(pb.cpp).string_type = STRING];

  // An opaque string generated by the partner that identifies an Entity.
  // Must be unique across all entities.
  // Strongly recommended to only include URL-safe characters.
  // Required.
  string entity_id = 1 [features.(pb.cpp).string_type = STRING];

  // Timestamp of when this availability slot starts in UTC.
  // Given in seconds since the unix epoch.
  // For example, 1735714800 seconds for 1 Jan 2025, 07:00:00 (UTC).
  // Required.
  int64 start_time_sec = 2;

  // Number of total spots and available spots of this booking availability.
  // E.g. a golf tee time of 4 spots with 2 booked.
  // golf_availability {spots_total: 4, spots_available: 2}
  // Required.
  int32 spots_total = 3;

  // Required.
  int32 spots_available = 4;

  // The minimum number of spots that should be booked for this availability.
  // For example, a user has to book at least 2 spots for a tee time sometimes.
  // If set, spots_minimum_book should be less or equal to spots_available.
  // Required.
  int32 spots_minimum_book = 5;

  // Link of this booking availability. Users will be redirected to partner
  // website to continue booking after clicking this link.
  // Required.
  string booking_link = 6 [features.(pb.cpp).string_type = STRING];

  // Base price per person.
  // Required.
  google.type.Money base_price = 7;

  // Fee per person.
  // Required.
  google.type.Money fee_price = 8;

  // Number of holes in the golf availability/tee time.
  // Required.
  enum Holes {
    option features.(pb.cpp).enum_name_uses_string_view = false;

    // Not specified. Do not use.
    HOLES_UNSPECIFIED = 0;

    // 6 Holes.
    SIX_HOLES = 5;

    // 9 Holes.
    NINE_HOLES = 1;

    // 12 Holes.
    TWELVE_HOLES = 2;

    // 14 Holes.
    FOURTEEN_HOLES = 3;

    // 18 Holes
    EIGHTEEN_HOLES = 4;
  }

  Holes holes = 9;

}

高尔夫球场空闲状态 Feed 示例

高尔夫球场空闲状态 Feed

{
  "data": [
    {
      "availability_id": "availability_id_1",
      "entity_id": "entity_id_1",
      "start_time_sec": 1728257400,
      "spots_total": 4,
      "spots_available": 4,
      "spots_minimum_book": 2,
      "booking_link": "https://www.googlegolfappointments.com/a_link_direct_to_booking_page",
      "base_price": {
        "currency_code": "USD",
        "units": 80,
        "nanos": 0
      },
      "holes": "EIGHTEEN_HOLES"
    },
    {
      "availability_id": "availability_id_2",
      "entity_id": "entity_id_2",
      "start_time_sec": 1728259200,
      "spots_total": 4,
      "spots_available": 4,
      "spots_minimum_book": 2,
      "booking_link": "https://googlegolfappointments.com/a_link_direct_to_booking_page",
      "base_price": {
        "currency_code": "USD",
        "units": 80,
        "nanos": 0
      },
      "holes": "NINE_HOLES"
    }
  ]
}

描述符文件

{
  "generation_timestamp": 1663347730,
  "name": "golf.availability",
  "data_file": [
    "golf.availability-1663347730-00000-of-00001.json"
  ]
}