CreateRepositoryProtectedBranchResult.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. #ifndef ALIBABACLOUD_CODEUP_MODEL_CREATEREPOSITORYPROTECTEDBRANCHRESULT_H_
  17. #define ALIBABACLOUD_CODEUP_MODEL_CREATEREPOSITORYPROTECTEDBRANCHRESULT_H_
  18. #include <string>
  19. #include <vector>
  20. #include <utility>
  21. #include <alibabacloud/core/ServiceResult.h>
  22. #include <alibabacloud/codeup/CodeupExport.h>
  23. namespace AlibabaCloud
  24. {
  25. namespace Codeup
  26. {
  27. namespace Model
  28. {
  29. class ALIBABACLOUD_CODEUP_EXPORT CreateRepositoryProtectedBranchResult : public ServiceResult
  30. {
  31. public:
  32. struct Result
  33. {
  34. struct MergeRequestSetting
  35. {
  36. bool required;
  37. std::vector<std::string> defaultAssignees;
  38. std::vector<std::string> allowMergeRequestRoles;
  39. bool isResetApprovalWhenNewPush;
  40. bool allowSelfApproval;
  41. int minimualApproval;
  42. bool isRequireDiscussionProcessed;
  43. std::string mergeRequestMode;
  44. };
  45. struct TestSetting
  46. {
  47. struct CodingGuidelinesDetection
  48. {
  49. std::string message;
  50. bool enabled;
  51. };
  52. struct SensitiveInfoDetection
  53. {
  54. std::string message;
  55. bool enabled;
  56. };
  57. struct CheckConfig
  58. {
  59. struct CheckItemsItem
  60. {
  61. bool required;
  62. std::string name;
  63. };
  64. std::vector<CheckItemsItem> checkItems;
  65. };
  66. SensitiveInfoDetection sensitiveInfoDetection;
  67. CodingGuidelinesDetection codingGuidelinesDetection;
  68. bool required;
  69. CheckConfig checkConfig;
  70. };
  71. std::vector<std::string> allowPushRoles;
  72. std::string branch;
  73. long id;
  74. TestSetting testSetting;
  75. std::vector<std::string> allowMergeRoles;
  76. MergeRequestSetting mergeRequestSetting;
  77. };
  78. CreateRepositoryProtectedBranchResult();
  79. explicit CreateRepositoryProtectedBranchResult(const std::string &payload);
  80. ~CreateRepositoryProtectedBranchResult();
  81. std::string getErrorCode()const;
  82. std::string getErrorMessage()const;
  83. bool getSuccess()const;
  84. Result getResult()const;
  85. protected:
  86. void parse(const std::string &payload);
  87. private:
  88. std::string errorCode_;
  89. std::string errorMessage_;
  90. bool success_;
  91. Result result_;
  92. };
  93. }
  94. }
  95. }
  96. #endif // !ALIBABACLOUD_CODEUP_MODEL_CREATEREPOSITORYPROTECTEDBRANCHRESULT_H_