aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/tvmauth/src/service_ticket.cpp
blob: 077049ef3ad17929b7b8d47039c983a5450f288c (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
35
36
37
38
39
40
41
#include "service_impl.h"

#include <library/cpp/tvmauth/checked_service_ticket.h>

namespace NTvmAuth {
    static const char* EX_MSG = "Ticket already moved out";

    TCheckedServiceTicket::TCheckedServiceTicket(THolder<TImpl> impl)
        : Impl_(std::move(impl))
    {
    }

    TCheckedServiceTicket::TCheckedServiceTicket(TCheckedServiceTicket&& o) = default;
    TCheckedServiceTicket& TCheckedServiceTicket::operator=(TCheckedServiceTicket&& o) = default;
    TCheckedServiceTicket::~TCheckedServiceTicket() = default;

    TCheckedServiceTicket::operator bool() const {
        Y_ENSURE(Impl_, EX_MSG);
        return Impl_->operator bool();
    }

    TTvmId TCheckedServiceTicket::GetSrc() const {
        Y_ENSURE(Impl_, EX_MSG);
        return Impl_->GetSrc();
    }

    ETicketStatus TCheckedServiceTicket::GetStatus() const {
        Y_ENSURE(Impl_, EX_MSG);
        return Impl_->GetStatus();
    }

    TString TCheckedServiceTicket::DebugInfo() const {
        Y_ENSURE(Impl_, EX_MSG);
        return Impl_->DebugInfo();
    }

    TMaybe<TUid> TCheckedServiceTicket::GetIssuerUid() const {
        Y_ENSURE(Impl_, EX_MSG);
        return Impl_->GetIssuerUid();
    }
}