QueryInvoicingCustomerListResult.cc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/bssopenapi/model/QueryInvoicingCustomerListResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::BssOpenApi;
  19. using namespace AlibabaCloud::BssOpenApi::Model;
  20. QueryInvoicingCustomerListResult::QueryInvoicingCustomerListResult() :
  21. ServiceResult()
  22. {}
  23. QueryInvoicingCustomerListResult::QueryInvoicingCustomerListResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. QueryInvoicingCustomerListResult::~QueryInvoicingCustomerListResult()
  29. {}
  30. void QueryInvoicingCustomerListResult::parse(const std::string &payload)
  31. {
  32. Json::Reader reader;
  33. Json::Value value;
  34. reader.parse(payload, value);
  35. setRequestId(value["RequestId"].asString());
  36. auto dataNode = value["Data"];
  37. auto allCustomerInvoiceList = value["CustomerInvoiceList"]["CustomerInvoice"];
  38. for (auto value : allCustomerInvoiceList)
  39. {
  40. Data::CustomerInvoice customerInvoiceObject;
  41. if(!value["Id"].isNull())
  42. customerInvoiceObject.id = std::stol(value["Id"].asString());
  43. if(!value["UserId"].isNull())
  44. customerInvoiceObject.userId = std::stol(value["UserId"].asString());
  45. if(!value["UserNick"].isNull())
  46. customerInvoiceObject.userNick = value["UserNick"].asString();
  47. if(!value["InvoiceTitle"].isNull())
  48. customerInvoiceObject.invoiceTitle = value["InvoiceTitle"].asString();
  49. if(!value["CustomerType"].isNull())
  50. customerInvoiceObject.customerType = std::stol(value["CustomerType"].asString());
  51. if(!value["TaxpayerType"].isNull())
  52. customerInvoiceObject.taxpayerType = std::stol(value["TaxpayerType"].asString());
  53. if(!value["Bank"].isNull())
  54. customerInvoiceObject.bank = value["Bank"].asString();
  55. if(!value["BankNo"].isNull())
  56. customerInvoiceObject.bankNo = value["BankNo"].asString();
  57. if(!value["OperatingLicenseAddress"].isNull())
  58. customerInvoiceObject.operatingLicenseAddress = value["OperatingLicenseAddress"].asString();
  59. if(!value["OperatingLicensePhone"].isNull())
  60. customerInvoiceObject.operatingLicensePhone = value["OperatingLicensePhone"].asString();
  61. if(!value["RegisterNo"].isNull())
  62. customerInvoiceObject.registerNo = value["RegisterNo"].asString();
  63. if(!value["StartCycle"].isNull())
  64. customerInvoiceObject.startCycle = std::stol(value["StartCycle"].asString());
  65. if(!value["Status"].isNull())
  66. customerInvoiceObject.status = std::stol(value["Status"].asString());
  67. if(!value["GmtCreate"].isNull())
  68. customerInvoiceObject.gmtCreate = value["GmtCreate"].asString();
  69. if(!value["TaxationLicense"].isNull())
  70. customerInvoiceObject.taxationLicense = value["TaxationLicense"].asString();
  71. if(!value["AdjustType"].isNull())
  72. customerInvoiceObject.adjustType = std::stol(value["AdjustType"].asString());
  73. if(!value["EndCycle"].isNull())
  74. customerInvoiceObject.endCycle = std::stol(value["EndCycle"].asString());
  75. if(!value["TitleChangeInstructions"].isNull())
  76. customerInvoiceObject.titleChangeInstructions = value["TitleChangeInstructions"].asString();
  77. if(!value["IssueType"].isNull())
  78. customerInvoiceObject.issueType = std::stol(value["IssueType"].asString());
  79. if(!value["Type"].isNull())
  80. customerInvoiceObject.type = std::stol(value["Type"].asString());
  81. if(!value["DefaultRemark"].isNull())
  82. customerInvoiceObject.defaultRemark = value["DefaultRemark"].asString();
  83. data_.customerInvoiceList.push_back(customerInvoiceObject);
  84. }
  85. if(!value["Success"].isNull())
  86. success_ = value["Success"].asString() == "true";
  87. if(!value["Code"].isNull())
  88. code_ = value["Code"].asString();
  89. if(!value["Message"].isNull())
  90. message_ = value["Message"].asString();
  91. }
  92. std::string QueryInvoicingCustomerListResult::getMessage()const
  93. {
  94. return message_;
  95. }
  96. QueryInvoicingCustomerListResult::Data QueryInvoicingCustomerListResult::getData()const
  97. {
  98. return data_;
  99. }
  100. std::string QueryInvoicingCustomerListResult::getCode()const
  101. {
  102. return code_;
  103. }
  104. bool QueryInvoicingCustomerListResult::getSuccess()const
  105. {
  106. return success_;
  107. }