client_method_options.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #include "client_method_options.h"
  2. #include "tvm.h"
  3. namespace NYT {
  4. template <typename T>
  5. static void MergeMaybe(TMaybe<T>& origin, const TMaybe<T>& patch)
  6. {
  7. if (patch) {
  8. origin = patch;
  9. }
  10. }
  11. void TFormatHints::Merge(const TFormatHints& patch)
  12. {
  13. if (patch.SkipNullValuesForTNode_) {
  14. SkipNullValuesForTNode(true);
  15. }
  16. MergeMaybe(EnableStringToAllConversion_, patch.EnableStringToAllConversion_);
  17. MergeMaybe(EnableAllToStringConversion_, patch.EnableAllToStringConversion_);
  18. MergeMaybe(EnableIntegralTypeConversion_, patch.EnableIntegralTypeConversion_);
  19. MergeMaybe(EnableIntegralToDoubleConversion_, patch.EnableIntegralToDoubleConversion_);
  20. MergeMaybe(EnableTypeConversion_, patch.EnableTypeConversion_);
  21. MergeMaybe(ComplexTypeMode_, patch.ComplexTypeMode_);
  22. }
  23. TCreateClientOptions& TCreateClientOptions::ServiceTicketAuth(const NAuth::IServiceTicketAuthPtrWrapper& wrapper)
  24. {
  25. ServiceTicketAuth_ = std::make_shared<NAuth::IServiceTicketAuthPtrWrapper>(wrapper);
  26. return *this;
  27. }
  28. } // namespace NYT