blob: e81fdc18d57aff91a5294647173d17c749717c2b [file] [log] [blame]
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Autogenerated by Thrift Compiler (0.9.2)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#include "security_model_types.h"
#include <algorithm>
#include <ostream>
#include <thrift/TToString.h>
namespace apache { namespace airavata { namespace model { namespace security {
AuthzToken::~AuthzToken() throw() {
}
void AuthzToken::__set_accessToken(const std::string& val) {
this->accessToken = val;
}
void AuthzToken::__set_claimsMap(const std::map<std::string, std::string> & val) {
this->claimsMap = val;
__isset.claimsMap = true;
}
const char* AuthzToken::ascii_fingerprint = "31FBBEA1FC165CE500F2DE705C5C27CE";
const uint8_t AuthzToken::binary_fingerprint[16] = {0x31,0xFB,0xBE,0xA1,0xFC,0x16,0x5C,0xE5,0x00,0xF2,0xDE,0x70,0x5C,0x5C,0x27,0xCE};
uint32_t AuthzToken::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
::apache::thrift::protocol::TType ftype;
int16_t fid;
xfer += iprot->readStructBegin(fname);
using ::apache::thrift::protocol::TProtocolException;
bool isset_accessToken = false;
while (true)
{
xfer += iprot->readFieldBegin(fname, ftype, fid);
if (ftype == ::apache::thrift::protocol::T_STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == ::apache::thrift::protocol::T_STRING) {
xfer += iprot->readString(this->accessToken);
isset_accessToken = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 2:
if (ftype == ::apache::thrift::protocol::T_MAP) {
{
this->claimsMap.clear();
uint32_t _size0;
::apache::thrift::protocol::TType _ktype1;
::apache::thrift::protocol::TType _vtype2;
xfer += iprot->readMapBegin(_ktype1, _vtype2, _size0);
uint32_t _i4;
for (_i4 = 0; _i4 < _size0; ++_i4)
{
std::string _key5;
xfer += iprot->readString(_key5);
std::string& _val6 = this->claimsMap[_key5];
xfer += iprot->readString(_val6);
}
xfer += iprot->readMapEnd();
}
this->__isset.claimsMap = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
}
xfer += iprot->readFieldEnd();
}
xfer += iprot->readStructEnd();
if (!isset_accessToken)
throw TProtocolException(TProtocolException::INVALID_DATA);
return xfer;
}
uint32_t AuthzToken::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
oprot->incrementRecursionDepth();
xfer += oprot->writeStructBegin("AuthzToken");
xfer += oprot->writeFieldBegin("accessToken", ::apache::thrift::protocol::T_STRING, 1);
xfer += oprot->writeString(this->accessToken);
xfer += oprot->writeFieldEnd();
if (this->__isset.claimsMap) {
xfer += oprot->writeFieldBegin("claimsMap", ::apache::thrift::protocol::T_MAP, 2);
{
xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->claimsMap.size()));
std::map<std::string, std::string> ::const_iterator _iter7;
for (_iter7 = this->claimsMap.begin(); _iter7 != this->claimsMap.end(); ++_iter7)
{
xfer += oprot->writeString(_iter7->first);
xfer += oprot->writeString(_iter7->second);
}
xfer += oprot->writeMapEnd();
}
xfer += oprot->writeFieldEnd();
}
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
oprot->decrementRecursionDepth();
return xfer;
}
void swap(AuthzToken &a, AuthzToken &b) {
using ::std::swap;
swap(a.accessToken, b.accessToken);
swap(a.claimsMap, b.claimsMap);
swap(a.__isset, b.__isset);
}
AuthzToken::AuthzToken(const AuthzToken& other8) {
accessToken = other8.accessToken;
claimsMap = other8.claimsMap;
__isset = other8.__isset;
}
AuthzToken& AuthzToken::operator=(const AuthzToken& other9) {
accessToken = other9.accessToken;
claimsMap = other9.claimsMap;
__isset = other9.__isset;
return *this;
}
std::ostream& operator<<(std::ostream& out, const AuthzToken& obj) {
using apache::thrift::to_string;
out << "AuthzToken(";
out << "accessToken=" << to_string(obj.accessToken);
out << ", " << "claimsMap="; (obj.__isset.claimsMap ? (out << to_string(obj.claimsMap)) : (out << "<null>"));
out << ")";
return out;
}
}}}} // namespace