aboutsummaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/interface/client_method_options.cpp
blob: 66f72bfe5fa80f3ed9230fc5871833c4ea9b24a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "client_method_options.h"

#include "tvm.h"

namespace NYT {

template <typename T>
static void MergeMaybe(TMaybe<T>& origin, const TMaybe<T>& patch)
{
    if (patch) {
        origin = patch;
    }
}

void TFormatHints::Merge(const TFormatHints& patch)
{
    if (patch.SkipNullValuesForTNode_) {
        SkipNullValuesForTNode(true);
    }
    MergeMaybe(EnableStringToAllConversion_, patch.EnableStringToAllConversion_);
    MergeMaybe(EnableAllToStringConversion_, patch.EnableAllToStringConversion_);
    MergeMaybe(EnableIntegralTypeConversion_, patch.EnableIntegralTypeConversion_);
    MergeMaybe(EnableIntegralToDoubleConversion_, patch.EnableIntegralToDoubleConversion_);
    MergeMaybe(EnableTypeConversion_, patch.EnableTypeConversion_);
    MergeMaybe(ComplexTypeMode_, patch.ComplexTypeMode_);
}

TCreateClientOptions& TCreateClientOptions::ServiceTicketAuth(const NAuth::IServiceTicketAuthPtrWrapper& wrapper)
{
    ServiceTicketAuth_ = std::make_shared<NAuth::IServiceTicketAuthPtrWrapper>(wrapper);
    return *this;
}

} // namespace NYT