New api publish.
This commit is contained in:
305
workorder/src/WorkorderClient.cc
Normal file
305
workorder/src/WorkorderClient.cc
Normal file
@@ -0,0 +1,305 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/WorkorderClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Workorder;
|
||||
using namespace AlibabaCloud::Workorder::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "Workorder";
|
||||
}
|
||||
|
||||
WorkorderClient::WorkorderClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "workorder");
|
||||
}
|
||||
|
||||
WorkorderClient::WorkorderClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "workorder");
|
||||
}
|
||||
|
||||
WorkorderClient::WorkorderClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "workorder");
|
||||
}
|
||||
|
||||
WorkorderClient::~WorkorderClient()
|
||||
{}
|
||||
|
||||
WorkorderClient::CloseTicketOutcome WorkorderClient::closeTicket(const CloseTicketRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CloseTicketOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CloseTicketOutcome(CloseTicketResult(outcome.result()));
|
||||
else
|
||||
return CloseTicketOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WorkorderClient::closeTicketAsync(const CloseTicketRequest& request, const CloseTicketAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, closeTicket(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WorkorderClient::CloseTicketOutcomeCallable WorkorderClient::closeTicketCallable(const CloseTicketRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CloseTicketOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->closeTicket(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
WorkorderClient::CreateTicketOutcome WorkorderClient::createTicket(const CreateTicketRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateTicketOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateTicketOutcome(CreateTicketResult(outcome.result()));
|
||||
else
|
||||
return CreateTicketOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WorkorderClient::createTicketAsync(const CreateTicketRequest& request, const CreateTicketAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createTicket(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WorkorderClient::CreateTicketOutcomeCallable WorkorderClient::createTicketCallable(const CreateTicketRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateTicketOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createTicket(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
WorkorderClient::ListCategoriesOutcome WorkorderClient::listCategories(const ListCategoriesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListCategoriesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListCategoriesOutcome(ListCategoriesResult(outcome.result()));
|
||||
else
|
||||
return ListCategoriesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WorkorderClient::listCategoriesAsync(const ListCategoriesRequest& request, const ListCategoriesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listCategories(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WorkorderClient::ListCategoriesOutcomeCallable WorkorderClient::listCategoriesCallable(const ListCategoriesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListCategoriesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listCategories(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
WorkorderClient::ListProductsOutcome WorkorderClient::listProducts(const ListProductsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListProductsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListProductsOutcome(ListProductsResult(outcome.result()));
|
||||
else
|
||||
return ListProductsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WorkorderClient::listProductsAsync(const ListProductsRequest& request, const ListProductsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listProducts(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WorkorderClient::ListProductsOutcomeCallable WorkorderClient::listProductsCallable(const ListProductsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListProductsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listProducts(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
WorkorderClient::ListTicketNotesOutcome WorkorderClient::listTicketNotes(const ListTicketNotesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListTicketNotesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListTicketNotesOutcome(ListTicketNotesResult(outcome.result()));
|
||||
else
|
||||
return ListTicketNotesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WorkorderClient::listTicketNotesAsync(const ListTicketNotesRequest& request, const ListTicketNotesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listTicketNotes(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WorkorderClient::ListTicketNotesOutcomeCallable WorkorderClient::listTicketNotesCallable(const ListTicketNotesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListTicketNotesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listTicketNotes(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
WorkorderClient::ListTicketsOutcome WorkorderClient::listTickets(const ListTicketsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListTicketsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListTicketsOutcome(ListTicketsResult(outcome.result()));
|
||||
else
|
||||
return ListTicketsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WorkorderClient::listTicketsAsync(const ListTicketsRequest& request, const ListTicketsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listTickets(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WorkorderClient::ListTicketsOutcomeCallable WorkorderClient::listTicketsCallable(const ListTicketsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListTicketsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listTickets(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
WorkorderClient::ReplyTicketOutcome WorkorderClient::replyTicket(const ReplyTicketRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ReplyTicketOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ReplyTicketOutcome(ReplyTicketResult(outcome.result()));
|
||||
else
|
||||
return ReplyTicketOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WorkorderClient::replyTicketAsync(const ReplyTicketRequest& request, const ReplyTicketAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, replyTicket(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WorkorderClient::ReplyTicketOutcomeCallable WorkorderClient::replyTicketCallable(const ReplyTicketRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ReplyTicketOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->replyTicket(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
51
workorder/src/model/CloseTicketRequest.cc
Normal file
51
workorder/src/model/CloseTicketRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/CloseTicketRequest.h>
|
||||
|
||||
using AlibabaCloud::Workorder::Model::CloseTicketRequest;
|
||||
|
||||
CloseTicketRequest::CloseTicketRequest() :
|
||||
RpcServiceRequest("workorder", "2020-03-26", "CloseTicket")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CloseTicketRequest::~CloseTicketRequest()
|
||||
{}
|
||||
|
||||
std::string CloseTicketRequest::getLanguage()const
|
||||
{
|
||||
return language_;
|
||||
}
|
||||
|
||||
void CloseTicketRequest::setLanguage(const std::string& language)
|
||||
{
|
||||
language_ = language;
|
||||
setParameter("Language", language);
|
||||
}
|
||||
|
||||
std::string CloseTicketRequest::getTicketId()const
|
||||
{
|
||||
return ticketId_;
|
||||
}
|
||||
|
||||
void CloseTicketRequest::setTicketId(const std::string& ticketId)
|
||||
{
|
||||
ticketId_ = ticketId;
|
||||
setParameter("TicketId", ticketId);
|
||||
}
|
||||
|
||||
65
workorder/src/model/CloseTicketResult.cc
Normal file
65
workorder/src/model/CloseTicketResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/CloseTicketResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Workorder;
|
||||
using namespace AlibabaCloud::Workorder::Model;
|
||||
|
||||
CloseTicketResult::CloseTicketResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CloseTicketResult::CloseTicketResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CloseTicketResult::~CloseTicketResult()
|
||||
{}
|
||||
|
||||
void CloseTicketResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CloseTicketResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int CloseTicketResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool CloseTicketResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
128
workorder/src/model/CreateTicketRequest.cc
Normal file
128
workorder/src/model/CreateTicketRequest.cc
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/CreateTicketRequest.h>
|
||||
|
||||
using AlibabaCloud::Workorder::Model::CreateTicketRequest;
|
||||
|
||||
CreateTicketRequest::CreateTicketRequest() :
|
||||
RpcServiceRequest("workorder", "2020-03-26", "CreateTicket")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateTicketRequest::~CreateTicketRequest()
|
||||
{}
|
||||
|
||||
std::string CreateTicketRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string CreateTicketRequest::getLanguage()const
|
||||
{
|
||||
return language_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setLanguage(const std::string& language)
|
||||
{
|
||||
language_ = language;
|
||||
setParameter("Language", language);
|
||||
}
|
||||
|
||||
std::string CreateTicketRequest::getTitle()const
|
||||
{
|
||||
return title_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setTitle(const std::string& title)
|
||||
{
|
||||
title_ = title;
|
||||
setParameter("Title", title);
|
||||
}
|
||||
|
||||
std::string CreateTicketRequest::getContent()const
|
||||
{
|
||||
return content_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setContent(const std::string& content)
|
||||
{
|
||||
content_ = content;
|
||||
setParameter("Content", content);
|
||||
}
|
||||
|
||||
std::string CreateTicketRequest::getNotifyTimeRange()const
|
||||
{
|
||||
return notifyTimeRange_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setNotifyTimeRange(const std::string& notifyTimeRange)
|
||||
{
|
||||
notifyTimeRange_ = notifyTimeRange;
|
||||
setParameter("NotifyTimeRange", notifyTimeRange);
|
||||
}
|
||||
|
||||
std::string CreateTicketRequest::getPhone()const
|
||||
{
|
||||
return phone_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setPhone(const std::string& phone)
|
||||
{
|
||||
phone_ = phone;
|
||||
setParameter("Phone", phone);
|
||||
}
|
||||
|
||||
std::string CreateTicketRequest::getCategory()const
|
||||
{
|
||||
return category_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setCategory(const std::string& category)
|
||||
{
|
||||
category_ = category;
|
||||
setParameter("Category", category);
|
||||
}
|
||||
|
||||
std::string CreateTicketRequest::getEmail()const
|
||||
{
|
||||
return email_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setEmail(const std::string& email)
|
||||
{
|
||||
email_ = email;
|
||||
setParameter("Email", email);
|
||||
}
|
||||
|
||||
std::string CreateTicketRequest::getSecretContent()const
|
||||
{
|
||||
return secretContent_;
|
||||
}
|
||||
|
||||
void CreateTicketRequest::setSecretContent(const std::string& secretContent)
|
||||
{
|
||||
secretContent_ = secretContent;
|
||||
setParameter("SecretContent", secretContent);
|
||||
}
|
||||
|
||||
72
workorder/src/model/CreateTicketResult.cc
Normal file
72
workorder/src/model/CreateTicketResult.cc
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/CreateTicketResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Workorder;
|
||||
using namespace AlibabaCloud::Workorder::Model;
|
||||
|
||||
CreateTicketResult::CreateTicketResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateTicketResult::CreateTicketResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateTicketResult::~CreateTicketResult()
|
||||
{}
|
||||
|
||||
void CreateTicketResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CreateTicketResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string CreateTicketResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string CreateTicketResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool CreateTicketResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
51
workorder/src/model/ListCategoriesRequest.cc
Normal file
51
workorder/src/model/ListCategoriesRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ListCategoriesRequest.h>
|
||||
|
||||
using AlibabaCloud::Workorder::Model::ListCategoriesRequest;
|
||||
|
||||
ListCategoriesRequest::ListCategoriesRequest() :
|
||||
RpcServiceRequest("workorder", "2020-03-26", "ListCategories")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListCategoriesRequest::~ListCategoriesRequest()
|
||||
{}
|
||||
|
||||
std::string ListCategoriesRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListCategoriesRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListCategoriesRequest::getLanguage()const
|
||||
{
|
||||
return language_;
|
||||
}
|
||||
|
||||
void ListCategoriesRequest::setLanguage(const std::string& language)
|
||||
{
|
||||
language_ = language;
|
||||
setParameter("Language", language);
|
||||
}
|
||||
|
||||
81
workorder/src/model/ListCategoriesResult.cc
Normal file
81
workorder/src/model/ListCategoriesResult.cc
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ListCategoriesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Workorder;
|
||||
using namespace AlibabaCloud::Workorder::Model;
|
||||
|
||||
ListCategoriesResult::ListCategoriesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListCategoriesResult::ListCategoriesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListCategoriesResult::~ListCategoriesResult()
|
||||
{}
|
||||
|
||||
void ListCategoriesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allListNode = dataNode["List"]["ListItem"];
|
||||
for (auto dataNodeListListItem : allListNode)
|
||||
{
|
||||
Data::ListItem listItemObject;
|
||||
if(!dataNodeListListItem["Id"].isNull())
|
||||
listItemObject.id = std::stoi(dataNodeListListItem["Id"].asString());
|
||||
if(!dataNodeListListItem["Name"].isNull())
|
||||
listItemObject.name = dataNodeListListItem["Name"].asString();
|
||||
data_.list.push_back(listItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string ListCategoriesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ListCategoriesResult::Data ListCategoriesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int ListCategoriesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ListCategoriesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
40
workorder/src/model/ListProductsRequest.cc
Normal file
40
workorder/src/model/ListProductsRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ListProductsRequest.h>
|
||||
|
||||
using AlibabaCloud::Workorder::Model::ListProductsRequest;
|
||||
|
||||
ListProductsRequest::ListProductsRequest() :
|
||||
RpcServiceRequest("workorder", "2020-03-26", "ListProducts")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListProductsRequest::~ListProductsRequest()
|
||||
{}
|
||||
|
||||
std::string ListProductsRequest::getLanguage()const
|
||||
{
|
||||
return language_;
|
||||
}
|
||||
|
||||
void ListProductsRequest::setLanguage(const std::string& language)
|
||||
{
|
||||
language_ = language;
|
||||
setParameter("Language", language);
|
||||
}
|
||||
|
||||
127
workorder/src/model/ListProductsResult.cc
Normal file
127
workorder/src/model/ListProductsResult.cc
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ListProductsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Workorder;
|
||||
using namespace AlibabaCloud::Workorder::Model;
|
||||
|
||||
ListProductsResult::ListProductsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListProductsResult::ListProductsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListProductsResult::~ListProductsResult()
|
||||
{}
|
||||
|
||||
void ListProductsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allTechMoreNode = dataNode["TechMore"]["TechMoreItem"];
|
||||
for (auto dataNodeTechMoreTechMoreItem : allTechMoreNode)
|
||||
{
|
||||
Data::TechMoreItem techMoreItemObject;
|
||||
if(!dataNodeTechMoreTechMoreItem["GroupName"].isNull())
|
||||
techMoreItemObject.groupName = dataNodeTechMoreTechMoreItem["GroupName"].asString();
|
||||
auto allProductListNode = allTechMoreNode["ProductList"]["ProductListItem"];
|
||||
for (auto allTechMoreNodeProductListProductListItem : allProductListNode)
|
||||
{
|
||||
Data::TechMoreItem::ProductListItem productListObject;
|
||||
if(!allTechMoreNodeProductListProductListItem["Name"].isNull())
|
||||
productListObject.name = allTechMoreNodeProductListProductListItem["Name"].asString();
|
||||
if(!allTechMoreNodeProductListProductListItem["ProductCode"].isNull())
|
||||
productListObject.productCode = allTechMoreNodeProductListProductListItem["ProductCode"].asString();
|
||||
if(!allTechMoreNodeProductListProductListItem["Description"].isNull())
|
||||
productListObject.description = allTechMoreNodeProductListProductListItem["Description"].asString();
|
||||
techMoreItemObject.productList.push_back(productListObject);
|
||||
}
|
||||
data_.techMore.push_back(techMoreItemObject);
|
||||
}
|
||||
auto allHotConsultationNode = dataNode["HotConsultation"]["HotConsultationItem"];
|
||||
for (auto dataNodeHotConsultationHotConsultationItem : allHotConsultationNode)
|
||||
{
|
||||
Data::HotConsultationItem hotConsultationItemObject;
|
||||
if(!dataNodeHotConsultationHotConsultationItem["Name"].isNull())
|
||||
hotConsultationItemObject.name = dataNodeHotConsultationHotConsultationItem["Name"].asString();
|
||||
if(!dataNodeHotConsultationHotConsultationItem["ProductCode"].isNull())
|
||||
hotConsultationItemObject.productCode = dataNodeHotConsultationHotConsultationItem["ProductCode"].asString();
|
||||
if(!dataNodeHotConsultationHotConsultationItem["Description"].isNull())
|
||||
hotConsultationItemObject.description = dataNodeHotConsultationHotConsultationItem["Description"].asString();
|
||||
data_.hotConsultation.push_back(hotConsultationItemObject);
|
||||
}
|
||||
auto allConsultationMoreNode = dataNode["ConsultationMore"]["ConsultationMoreItem"];
|
||||
for (auto dataNodeConsultationMoreConsultationMoreItem : allConsultationMoreNode)
|
||||
{
|
||||
Data::ConsultationMoreItem consultationMoreItemObject;
|
||||
if(!dataNodeConsultationMoreConsultationMoreItem["Name"].isNull())
|
||||
consultationMoreItemObject.name = dataNodeConsultationMoreConsultationMoreItem["Name"].asString();
|
||||
if(!dataNodeConsultationMoreConsultationMoreItem["ProductCode"].isNull())
|
||||
consultationMoreItemObject.productCode = dataNodeConsultationMoreConsultationMoreItem["ProductCode"].asString();
|
||||
if(!dataNodeConsultationMoreConsultationMoreItem["Description"].isNull())
|
||||
consultationMoreItemObject.description = dataNodeConsultationMoreConsultationMoreItem["Description"].asString();
|
||||
data_.consultationMore.push_back(consultationMoreItemObject);
|
||||
}
|
||||
auto allHotTechNode = dataNode["HotTech"]["HotTechItem"];
|
||||
for (auto dataNodeHotTechHotTechItem : allHotTechNode)
|
||||
{
|
||||
Data::HotTechItem hotTechItemObject;
|
||||
if(!dataNodeHotTechHotTechItem["Name"].isNull())
|
||||
hotTechItemObject.name = dataNodeHotTechHotTechItem["Name"].asString();
|
||||
if(!dataNodeHotTechHotTechItem["ProductCode"].isNull())
|
||||
hotTechItemObject.productCode = dataNodeHotTechHotTechItem["ProductCode"].asString();
|
||||
if(!dataNodeHotTechHotTechItem["Description"].isNull())
|
||||
hotTechItemObject.description = dataNodeHotTechHotTechItem["Description"].asString();
|
||||
data_.hotTech.push_back(hotTechItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ListProductsResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ListProductsResult::Data ListProductsResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int ListProductsResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ListProductsResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
51
workorder/src/model/ListTicketNotesRequest.cc
Normal file
51
workorder/src/model/ListTicketNotesRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ListTicketNotesRequest.h>
|
||||
|
||||
using AlibabaCloud::Workorder::Model::ListTicketNotesRequest;
|
||||
|
||||
ListTicketNotesRequest::ListTicketNotesRequest() :
|
||||
RpcServiceRequest("workorder", "2020-03-26", "ListTicketNotes")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListTicketNotesRequest::~ListTicketNotesRequest()
|
||||
{}
|
||||
|
||||
std::string ListTicketNotesRequest::getLanguage()const
|
||||
{
|
||||
return language_;
|
||||
}
|
||||
|
||||
void ListTicketNotesRequest::setLanguage(const std::string& language)
|
||||
{
|
||||
language_ = language;
|
||||
setParameter("Language", language);
|
||||
}
|
||||
|
||||
std::string ListTicketNotesRequest::getTicketId()const
|
||||
{
|
||||
return ticketId_;
|
||||
}
|
||||
|
||||
void ListTicketNotesRequest::setTicketId(const std::string& ticketId)
|
||||
{
|
||||
ticketId_ = ticketId;
|
||||
setParameter("TicketId", ticketId);
|
||||
}
|
||||
|
||||
85
workorder/src/model/ListTicketNotesResult.cc
Normal file
85
workorder/src/model/ListTicketNotesResult.cc
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ListTicketNotesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Workorder;
|
||||
using namespace AlibabaCloud::Workorder::Model;
|
||||
|
||||
ListTicketNotesResult::ListTicketNotesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListTicketNotesResult::ListTicketNotesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListTicketNotesResult::~ListTicketNotesResult()
|
||||
{}
|
||||
|
||||
void ListTicketNotesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allListNode = dataNode["List"]["ListItem"];
|
||||
for (auto dataNodeListListItem : allListNode)
|
||||
{
|
||||
Data::ListItem listItemObject;
|
||||
if(!dataNodeListListItem["FromOfficial"].isNull())
|
||||
listItemObject.fromOfficial = dataNodeListListItem["FromOfficial"].asString() == "true";
|
||||
if(!dataNodeListListItem["GmtCreated"].isNull())
|
||||
listItemObject.gmtCreated = std::stoi(dataNodeListListItem["GmtCreated"].asString());
|
||||
if(!dataNodeListListItem["NoteId"].isNull())
|
||||
listItemObject.noteId = dataNodeListListItem["NoteId"].asString();
|
||||
if(!dataNodeListListItem["Content"].isNull())
|
||||
listItemObject.content = dataNodeListListItem["Content"].asString();
|
||||
data_.list.push_back(listItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ListTicketNotesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ListTicketNotesResult::Data ListTicketNotesResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int ListTicketNotesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ListTicketNotesResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
128
workorder/src/model/ListTicketsRequest.cc
Normal file
128
workorder/src/model/ListTicketsRequest.cc
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ListTicketsRequest.h>
|
||||
|
||||
using AlibabaCloud::Workorder::Model::ListTicketsRequest;
|
||||
|
||||
ListTicketsRequest::ListTicketsRequest() :
|
||||
RpcServiceRequest("workorder", "2020-03-26", "ListTickets")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListTicketsRequest::~ListTicketsRequest()
|
||||
{}
|
||||
|
||||
std::string ListTicketsRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListTicketsRequest::getLanguage()const
|
||||
{
|
||||
return language_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setLanguage(const std::string& language)
|
||||
{
|
||||
language_ = language;
|
||||
setParameter("Language", language);
|
||||
}
|
||||
|
||||
std::string ListTicketsRequest::getSubUserId()const
|
||||
{
|
||||
return subUserId_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setSubUserId(const std::string& subUserId)
|
||||
{
|
||||
subUserId_ = subUserId;
|
||||
setParameter("SubUserId", subUserId);
|
||||
}
|
||||
|
||||
long ListTicketsRequest::getCreatedBeforeTime()const
|
||||
{
|
||||
return createdBeforeTime_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setCreatedBeforeTime(long createdBeforeTime)
|
||||
{
|
||||
createdBeforeTime_ = createdBeforeTime;
|
||||
setParameter("CreatedBeforeTime", std::to_string(createdBeforeTime));
|
||||
}
|
||||
|
||||
int ListTicketsRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string ListTicketsRequest::getIds()const
|
||||
{
|
||||
return ids_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setIds(const std::string& ids)
|
||||
{
|
||||
ids_ = ids;
|
||||
setParameter("Ids", ids);
|
||||
}
|
||||
|
||||
std::string ListTicketsRequest::getTicketStatus()const
|
||||
{
|
||||
return ticketStatus_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setTicketStatus(const std::string& ticketStatus)
|
||||
{
|
||||
ticketStatus_ = ticketStatus;
|
||||
setParameter("TicketStatus", ticketStatus);
|
||||
}
|
||||
|
||||
int ListTicketsRequest::getPageStart()const
|
||||
{
|
||||
return pageStart_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setPageStart(int pageStart)
|
||||
{
|
||||
pageStart_ = pageStart;
|
||||
setParameter("PageStart", std::to_string(pageStart));
|
||||
}
|
||||
|
||||
long ListTicketsRequest::getCreatedAfterTime()const
|
||||
{
|
||||
return createdAfterTime_;
|
||||
}
|
||||
|
||||
void ListTicketsRequest::setCreatedAfterTime(long createdAfterTime)
|
||||
{
|
||||
createdAfterTime_ = createdAfterTime;
|
||||
setParameter("CreatedAfterTime", std::to_string(createdAfterTime));
|
||||
}
|
||||
|
||||
93
workorder/src/model/ListTicketsResult.cc
Normal file
93
workorder/src/model/ListTicketsResult.cc
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ListTicketsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Workorder;
|
||||
using namespace AlibabaCloud::Workorder::Model;
|
||||
|
||||
ListTicketsResult::ListTicketsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListTicketsResult::ListTicketsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListTicketsResult::~ListTicketsResult()
|
||||
{}
|
||||
|
||||
void ListTicketsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Total"].isNull())
|
||||
data_.total = std::stoi(dataNode["Total"].asString());
|
||||
if(!dataNode["PageSize"].isNull())
|
||||
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
|
||||
if(!dataNode["CurrentPage"].isNull())
|
||||
data_.currentPage = std::stoi(dataNode["CurrentPage"].asString());
|
||||
auto allListNode = dataNode["List"]["ListItem"];
|
||||
for (auto dataNodeListListItem : allListNode)
|
||||
{
|
||||
Data::ListItem listItemObject;
|
||||
if(!dataNodeListListItem["AddTime"].isNull())
|
||||
listItemObject.addTime = std::stoi(dataNodeListListItem["AddTime"].asString());
|
||||
if(!dataNodeListListItem["TicketStatus"].isNull())
|
||||
listItemObject.ticketStatus = dataNodeListListItem["TicketStatus"].asString();
|
||||
if(!dataNodeListListItem["CreatorId"].isNull())
|
||||
listItemObject.creatorId = dataNodeListListItem["CreatorId"].asString();
|
||||
if(!dataNodeListListItem["Id"].isNull())
|
||||
listItemObject.id = dataNodeListListItem["Id"].asString();
|
||||
if(!dataNodeListListItem["Title"].isNull())
|
||||
listItemObject.title = dataNodeListListItem["Title"].asString();
|
||||
data_.list.push_back(listItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ListTicketsResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ListTicketsResult::Data ListTicketsResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int ListTicketsResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ListTicketsResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
73
workorder/src/model/ReplyTicketRequest.cc
Normal file
73
workorder/src/model/ReplyTicketRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ReplyTicketRequest.h>
|
||||
|
||||
using AlibabaCloud::Workorder::Model::ReplyTicketRequest;
|
||||
|
||||
ReplyTicketRequest::ReplyTicketRequest() :
|
||||
RpcServiceRequest("workorder", "2020-03-26", "ReplyTicket")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ReplyTicketRequest::~ReplyTicketRequest()
|
||||
{}
|
||||
|
||||
std::string ReplyTicketRequest::getLanguage()const
|
||||
{
|
||||
return language_;
|
||||
}
|
||||
|
||||
void ReplyTicketRequest::setLanguage(const std::string& language)
|
||||
{
|
||||
language_ = language;
|
||||
setParameter("Language", language);
|
||||
}
|
||||
|
||||
std::string ReplyTicketRequest::getTicketId()const
|
||||
{
|
||||
return ticketId_;
|
||||
}
|
||||
|
||||
void ReplyTicketRequest::setTicketId(const std::string& ticketId)
|
||||
{
|
||||
ticketId_ = ticketId;
|
||||
setParameter("TicketId", ticketId);
|
||||
}
|
||||
|
||||
std::string ReplyTicketRequest::getContent()const
|
||||
{
|
||||
return content_;
|
||||
}
|
||||
|
||||
void ReplyTicketRequest::setContent(const std::string& content)
|
||||
{
|
||||
content_ = content;
|
||||
setParameter("Content", content);
|
||||
}
|
||||
|
||||
std::string ReplyTicketRequest::getSecretContent()const
|
||||
{
|
||||
return secretContent_;
|
||||
}
|
||||
|
||||
void ReplyTicketRequest::setSecretContent(const std::string& secretContent)
|
||||
{
|
||||
secretContent_ = secretContent;
|
||||
setParameter("SecretContent", secretContent);
|
||||
}
|
||||
|
||||
65
workorder/src/model/ReplyTicketResult.cc
Normal file
65
workorder/src/model/ReplyTicketResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/workorder/model/ReplyTicketResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Workorder;
|
||||
using namespace AlibabaCloud::Workorder::Model;
|
||||
|
||||
ReplyTicketResult::ReplyTicketResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ReplyTicketResult::ReplyTicketResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ReplyTicketResult::~ReplyTicketResult()
|
||||
{}
|
||||
|
||||
void ReplyTicketResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ReplyTicketResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int ReplyTicketResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ReplyTicketResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user