blob: b808c41a06c33bd799593f0c6f912fa7ea9b64e3 [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.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#include "account_provisioning_model_types.h"
#include <algorithm>
#include <ostream>
#include <thrift/TToString.h>
namespace apache { namespace airavata { namespace model { namespace appcatalog { namespace accountprovisioning {
int _kSSHAccountProvisionerConfigParamTypeValues[] = {
SSHAccountProvisionerConfigParamType::STRING,
SSHAccountProvisionerConfigParamType::CRED_STORE_PASSWORD_TOKEN
};
const char* _kSSHAccountProvisionerConfigParamTypeNames[] = {
"STRING",
"CRED_STORE_PASSWORD_TOKEN"
};
const std::map<int, const char*> _SSHAccountProvisionerConfigParamType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kSSHAccountProvisionerConfigParamTypeValues, _kSSHAccountProvisionerConfigParamTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
SSHAccountProvisionerConfigParam::~SSHAccountProvisionerConfigParam() throw() {
}
void SSHAccountProvisionerConfigParam::__set_name(const std::string& val) {
this->name = val;
}
void SSHAccountProvisionerConfigParam::__set_type(const SSHAccountProvisionerConfigParamType::type val) {
this->type = val;
}
void SSHAccountProvisionerConfigParam::__set_isOptional(const bool val) {
this->isOptional = val;
}
void SSHAccountProvisionerConfigParam::__set_description(const std::string& val) {
this->description = val;
__isset.description = true;
}
uint32_t SSHAccountProvisionerConfigParam::read(::apache::thrift::protocol::TProtocol* iprot) {
apache::thrift::protocol::TInputRecursionTracker tracker(*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_name = false;
bool isset_type = false;
bool isset_isOptional = 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->name);
isset_name = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 2:
if (ftype == ::apache::thrift::protocol::T_I32) {
int32_t ecast0;
xfer += iprot->readI32(ecast0);
this->type = (SSHAccountProvisionerConfigParamType::type)ecast0;
isset_type = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 3:
if (ftype == ::apache::thrift::protocol::T_BOOL) {
xfer += iprot->readBool(this->isOptional);
isset_isOptional = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 4:
if (ftype == ::apache::thrift::protocol::T_STRING) {
xfer += iprot->readString(this->description);
this->__isset.description = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
}
xfer += iprot->readFieldEnd();
}
xfer += iprot->readStructEnd();
if (!isset_name)
throw TProtocolException(TProtocolException::INVALID_DATA);
if (!isset_type)
throw TProtocolException(TProtocolException::INVALID_DATA);
if (!isset_isOptional)
throw TProtocolException(TProtocolException::INVALID_DATA);
return xfer;
}
uint32_t SSHAccountProvisionerConfigParam::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
xfer += oprot->writeStructBegin("SSHAccountProvisionerConfigParam");
xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
xfer += oprot->writeString(this->name);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 2);
xfer += oprot->writeI32((int32_t)this->type);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("isOptional", ::apache::thrift::protocol::T_BOOL, 3);
xfer += oprot->writeBool(this->isOptional);
xfer += oprot->writeFieldEnd();
if (this->__isset.description) {
xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 4);
xfer += oprot->writeString(this->description);
xfer += oprot->writeFieldEnd();
}
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
}
void swap(SSHAccountProvisionerConfigParam &a, SSHAccountProvisionerConfigParam &b) {
using ::std::swap;
swap(a.name, b.name);
swap(a.type, b.type);
swap(a.isOptional, b.isOptional);
swap(a.description, b.description);
swap(a.__isset, b.__isset);
}
SSHAccountProvisionerConfigParam::SSHAccountProvisionerConfigParam(const SSHAccountProvisionerConfigParam& other1) {
name = other1.name;
type = other1.type;
isOptional = other1.isOptional;
description = other1.description;
__isset = other1.__isset;
}
SSHAccountProvisionerConfigParam& SSHAccountProvisionerConfigParam::operator=(const SSHAccountProvisionerConfigParam& other2) {
name = other2.name;
type = other2.type;
isOptional = other2.isOptional;
description = other2.description;
__isset = other2.__isset;
return *this;
}
void SSHAccountProvisionerConfigParam::printTo(std::ostream& out) const {
using ::apache::thrift::to_string;
out << "SSHAccountProvisionerConfigParam(";
out << "name=" << to_string(name);
out << ", " << "type=" << to_string(type);
out << ", " << "isOptional=" << to_string(isOptional);
out << ", " << "description="; (__isset.description ? (out << to_string(description)) : (out << "<null>"));
out << ")";
}
SSHAccountProvisioner::~SSHAccountProvisioner() throw() {
}
void SSHAccountProvisioner::__set_name(const std::string& val) {
this->name = val;
}
void SSHAccountProvisioner::__set_canCreateAccount(const bool val) {
this->canCreateAccount = val;
}
void SSHAccountProvisioner::__set_canInstallSSHKey(const bool val) {
this->canInstallSSHKey = val;
}
void SSHAccountProvisioner::__set_configParams(const std::vector<SSHAccountProvisionerConfigParam> & val) {
this->configParams = val;
}
uint32_t SSHAccountProvisioner::read(::apache::thrift::protocol::TProtocol* iprot) {
apache::thrift::protocol::TInputRecursionTracker tracker(*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_name = false;
bool isset_canCreateAccount = false;
bool isset_canInstallSSHKey = false;
bool isset_configParams = 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->name);
isset_name = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 2:
if (ftype == ::apache::thrift::protocol::T_BOOL) {
xfer += iprot->readBool(this->canCreateAccount);
isset_canCreateAccount = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 3:
if (ftype == ::apache::thrift::protocol::T_BOOL) {
xfer += iprot->readBool(this->canInstallSSHKey);
isset_canInstallSSHKey = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 4:
if (ftype == ::apache::thrift::protocol::T_LIST) {
{
this->configParams.clear();
uint32_t _size3;
::apache::thrift::protocol::TType _etype6;
xfer += iprot->readListBegin(_etype6, _size3);
this->configParams.resize(_size3);
uint32_t _i7;
for (_i7 = 0; _i7 < _size3; ++_i7)
{
xfer += this->configParams[_i7].read(iprot);
}
xfer += iprot->readListEnd();
}
isset_configParams = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
}
xfer += iprot->readFieldEnd();
}
xfer += iprot->readStructEnd();
if (!isset_name)
throw TProtocolException(TProtocolException::INVALID_DATA);
if (!isset_canCreateAccount)
throw TProtocolException(TProtocolException::INVALID_DATA);
if (!isset_canInstallSSHKey)
throw TProtocolException(TProtocolException::INVALID_DATA);
if (!isset_configParams)
throw TProtocolException(TProtocolException::INVALID_DATA);
return xfer;
}
uint32_t SSHAccountProvisioner::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
xfer += oprot->writeStructBegin("SSHAccountProvisioner");
xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
xfer += oprot->writeString(this->name);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("canCreateAccount", ::apache::thrift::protocol::T_BOOL, 2);
xfer += oprot->writeBool(this->canCreateAccount);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("canInstallSSHKey", ::apache::thrift::protocol::T_BOOL, 3);
xfer += oprot->writeBool(this->canInstallSSHKey);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("configParams", ::apache::thrift::protocol::T_LIST, 4);
{
xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->configParams.size()));
std::vector<SSHAccountProvisionerConfigParam> ::const_iterator _iter8;
for (_iter8 = this->configParams.begin(); _iter8 != this->configParams.end(); ++_iter8)
{
xfer += (*_iter8).write(oprot);
}
xfer += oprot->writeListEnd();
}
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
}
void swap(SSHAccountProvisioner &a, SSHAccountProvisioner &b) {
using ::std::swap;
swap(a.name, b.name);
swap(a.canCreateAccount, b.canCreateAccount);
swap(a.canInstallSSHKey, b.canInstallSSHKey);
swap(a.configParams, b.configParams);
}
SSHAccountProvisioner::SSHAccountProvisioner(const SSHAccountProvisioner& other9) {
name = other9.name;
canCreateAccount = other9.canCreateAccount;
canInstallSSHKey = other9.canInstallSSHKey;
configParams = other9.configParams;
}
SSHAccountProvisioner& SSHAccountProvisioner::operator=(const SSHAccountProvisioner& other10) {
name = other10.name;
canCreateAccount = other10.canCreateAccount;
canInstallSSHKey = other10.canInstallSSHKey;
configParams = other10.configParams;
return *this;
}
void SSHAccountProvisioner::printTo(std::ostream& out) const {
using ::apache::thrift::to_string;
out << "SSHAccountProvisioner(";
out << "name=" << to_string(name);
out << ", " << "canCreateAccount=" << to_string(canCreateAccount);
out << ", " << "canInstallSSHKey=" << to_string(canInstallSSHKey);
out << ", " << "configParams=" << to_string(configParams);
out << ")";
}
}}}}} // namespace