Metapolicy_struct

#how-tos

ℹ️
На этой странице показано, как отображать объект metapolicy_struct в Node.js и Python.

Прочтите дамп построчно и найдите необходимый отель.

  1. Прочитайте объекты.
  2. При необходимости измените значения.
  3. Учитывайте, что объекты могут быть null или пустыми — обрабатывайте такие случаи.
  4. Покажите значения пользователю. Например, используйте такие строки:
    • deposit — данные о депозите.
      1console.log('Deposit is %s to have. %s %s %s The price is %s %s %s.',
      2  deposit.availability, deposit.type, deposit.payment_type, deposit.pricing_method, deposit.price, deposit.currency, deposit.price_unit);
      print(f"Deposit is {deposit.availability} to have." +
               f" {deposit.type} {deposit.payment_type} {deposit.pricing_method}" +
               f" The price is {deposit.price} {deposit.currency} {deposit.price_unit}."
      )
    • internet — наличие интернета в отеле и правила использования.
      1console.log('%s is %s to the overall price. The price is %s %s %s. %s.',
      2  internet.type, internet.inclusion, internet.price, internet.currency, internet.price_unit, internet.work_area);
      print(f"{internet.type} is {internet.inclusion} to the overall price. " +
               f"The price is {internet.price} {internet.currency} {internet.price_unit}. {internet.work_area}."
      )
    • meal — информация о предоставляемом питании для взрослых.
      1console.log('%s is %s to the overall price. The price is %s %s per a person.',
      2  meal.type, meal.inclusion, meal.price, meal.currency);
      print(f"{meal.type} is {meal.inclusion} to the overall price. " +
               f"The price is {meal.price} {meal.currency} per a person."
      )
    • children_meal — информация о предоставляемом питании для детей.
      1console.log('%s is %s to the overall price. For children of %s–%s y.o. The price is %s %s per a child.',
      2 children_meal.type, children_meal.inclusion, children_meal.age_start, children_meal.age_end, children_meal.price, children_meal.currency);
      print(f"{children_meal.type} is {children_meal.inclusion} to the overall price. " +
               f"For children of {children_meal.age_start}–{children_meal.age_end} y.o." +
               f" The price is {children_meal.price} {children_meal.currency} per a child."
      )
    • extra_bed — правила предоставления дополнительных кроватей для взрослых.
      1console.log('%s bed(s). %s to the overall price. The price is %s %s %s.',
      2  extra_bed.amount, extra_bed.inclusion, extra_bed.price, extra_bed.currency, extra_bed.price_unit);
      print(f"{extra_bed.amount} bed(s). {extra_bed.inclusion} to the overall price. " +
               f"The price is {extra_bed.price} {extra_bed.currency} {extra_bed.price_unit}."
      )
    • cot — правила в отношении детских кроваток.
      1console.log('%s cot(s). %s to the overall price. The price is %s %s %s.',
      2  cot.amount, cot.inclusion, cot.price, cot.currency, cot.price_unit);
      print(f"{cot.amount} cot(s). {cot.inclusion} to the overall price. " +
               f"The price is {cot.price} {cot.currency} {cot.price_unit}."
      )
    • pets — правила размещения с животными.
      1console.log('Pet weight is %s is %s to the overall price. The price is %s %s %s.',
      2  pets.pets_type, pets.inclusion, pets.price, pets.currency, pets.price_unit);
      print(f"Pet weight is {pets.pets_type} is {pets.inclusion} to the overall price. " +
               f"The price is {pets.price} {pets.currency} {pets.price_unit}."
      )
    • shuttle — правила предоставления трансферов.
      1console.log('Shuttle is %s to %s. %s to the overall price. The price is %s %s.',
      2  shuttle.shuttle_type, shuttle.destination_type, shuttle.inclusion, shuttle.price, shuttle.currency);
      print(f"Shuttle is {shuttle.shuttle_type} to {shuttle.destination_type}. " +
               f"{shuttle.inclusion} to the overall price. " +
               f"The price is {shuttle.price} {shuttle.currency}."
      )
    • parking — информация о парковке.
      1console.log('Parking is %s and %s to the overall price. The price is %s %s %s.',
      2  parking.territory_type, parking.inclusion, parking.price, parking.currency, parking.price_unit);
      print(f"Parking is {parking.territory_type} and {parking.inclusion} to the overall price. " +
             f"The price is {parking.price} {parking.currency} {parking.price_unit}."
      )
    • children — политика предоставления дополнительных кроватей для детей.
      1console.log('Bed for a child is %s. For children of %s–%s y.o. The price is %s %s.',
      2   children.extra_bed, children.age_start, children.age_end, children.price, children.currency);
      print(f"Bed for a child is {children.extra_bed}. " +
               f"For children of {children.age_start}–{children.age_end} y.o. " +
               f"The price is {children.price} {children.currency}."
      )
    • visa — информация о визовой поддержке.
      1console.log('Visa support for the embassy is %s.',
      2  visa.visa_support);
      print(f"Visa support for the embassy is {visa.visa_support}.")
    • no_show — политика в случае незаезда.
      1console.log('No-show is %s to have %s at %s.',
      2  no_show.availability, no_show.day_period, no_show.time);
      print(f"No-show is {no_show.availability} to have {
         no_show.day_period} at {no_show.time}."
      )
    • add_fee — дополнительные услуги, сборы и налоги.
      1console.log('Additional service is for %s. The price is %s %s %s.',
      2  add_fee.fee_type, add_fee.price, add_fee.currency, add_fee.price_unit);
      print(f"Additional service is for {add_fee.fee_type}. " +
               f"The price is {add_fee.price} {add_fee.currency} {add_fee.price_unit}."
      )
    • check_in_check_out — правила заезда и выезда.
      1console.log('%s is %s to the overall price. The price is %s %s.',
      2  check_in_check_out.check_in_check_out_type, check_in_check_out.inclusion, check_in_check_out.price, check_in_check_out.currency);
      print(f"{check_in_check_out.check_in_check_out_type} is {check_in_check_out.inclusion} to the overall price." +
               f" The price is {check_in_check_out.price} {check_in_check_out.currency}."
      )