forgejo 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/CHANGELOG.md~ +3 -0
  4. data/Makefile +16 -16
  5. data/README.md +68 -12
  6. data/config.yaml +21 -0
  7. data/config.yaml~ +13 -0
  8. data/docs/APIForbiddenError.md +20 -0
  9. data/docs/APIInvalidTopicsError.md +20 -0
  10. data/docs/APINotFound.md +22 -0
  11. data/docs/APIRepoArchivedError.md +20 -0
  12. data/docs/APIUnauthorizedError.md +20 -0
  13. data/docs/APIValidationError.md +20 -0
  14. data/docs/ActivitypubApi.md +133 -0
  15. data/docs/AdminApi.md +1305 -184
  16. data/docs/Attachment.md +2 -0
  17. data/docs/CreatePushMirrorOption.md +3 -1
  18. data/docs/CreateQuotaGroupOptions.md +20 -0
  19. data/docs/CreateQuotaRuleOptions.md +22 -0
  20. data/docs/EditAttachmentOptions.md +2 -0
  21. data/docs/EditQuotaRuleOptions.md +20 -0
  22. data/docs/EditRepoOption.md +2 -0
  23. data/docs/IssueApi.md +55 -55
  24. data/docs/MarkupOption.md +2 -0
  25. data/docs/NoteOptions.md +18 -0
  26. data/docs/OrganizationApi.md +386 -19
  27. data/docs/PackageApi.md +1 -1
  28. data/docs/PullRequest.md +2 -0
  29. data/docs/PushMirror.md +2 -0
  30. data/docs/QuotaGroup.md +20 -0
  31. data/docs/QuotaInfo.md +20 -0
  32. data/docs/QuotaRuleInfo.md +22 -0
  33. data/docs/QuotaUsed.md +18 -0
  34. data/docs/QuotaUsedArtifact.md +22 -0
  35. data/docs/QuotaUsedAttachment.md +24 -0
  36. data/docs/QuotaUsedAttachmentContainedIn.md +20 -0
  37. data/docs/QuotaUsedPackage.md +26 -0
  38. data/docs/QuotaUsedSize.md +22 -0
  39. data/docs/QuotaUsedSizeAssets.md +22 -0
  40. data/docs/QuotaUsedSizeAssetsAttachments.md +20 -0
  41. data/docs/QuotaUsedSizeAssetsPackages.md +18 -0
  42. data/docs/QuotaUsedSizeGit.md +18 -0
  43. data/docs/QuotaUsedSizeRepos.md +20 -0
  44. data/docs/RepoCreateReleaseAttachmentRequest.md +4 -2
  45. data/docs/Repository.md +2 -0
  46. data/docs/RepositoryApi.md +308 -72
  47. data/docs/SetUserQuotaGroupsOptions.md +18 -0
  48. data/docs/UpdateBranchRepoOption.md +18 -0
  49. data/docs/UserApi.md +390 -33
  50. data/forgejo.gemspec +12 -13
  51. data/lib/forgejo/api/activitypub_api.rb +110 -2
  52. data/lib/forgejo/api/admin_api.rb +1148 -109
  53. data/lib/forgejo/api/issue_api.rb +94 -36
  54. data/lib/forgejo/api/miscellaneous_api.rb +2 -2
  55. data/lib/forgejo/api/notification_api.rb +2 -2
  56. data/lib/forgejo/api/organization_api.rb +363 -2
  57. data/lib/forgejo/api/package_api.rb +4 -2
  58. data/lib/forgejo/api/repository_api.rb +370 -26
  59. data/lib/forgejo/api/settings_api.rb +2 -2
  60. data/lib/forgejo/api/user_api.rb +350 -8
  61. data/lib/forgejo/api_client.rb +2 -2
  62. data/lib/forgejo/api_error.rb +2 -2
  63. data/lib/forgejo/configuration.rb +2 -2
  64. data/lib/forgejo/models/access_token.rb +11 -5
  65. data/lib/forgejo/models/action_task.rb +11 -5
  66. data/lib/forgejo/models/action_task_response.rb +11 -5
  67. data/lib/forgejo/models/action_variable.rb +11 -5
  68. data/lib/forgejo/models/activity.rb +11 -5
  69. data/lib/forgejo/models/activity_pub.rb +11 -5
  70. data/lib/forgejo/models/add_collaborator_option.rb +45 -5
  71. data/lib/forgejo/models/add_time_option.rb +21 -5
  72. data/lib/forgejo/models/annotated_tag.rb +11 -5
  73. data/lib/forgejo/models/annotated_tag_object.rb +11 -5
  74. data/lib/forgejo/models/api_error.rb +11 -5
  75. data/lib/forgejo/models/api_forbidden_error.rb +229 -0
  76. data/lib/forgejo/models/api_invalid_topics_error.rb +231 -0
  77. data/lib/forgejo/models/api_not_found.rb +240 -0
  78. data/lib/forgejo/models/api_repo_archived_error.rb +229 -0
  79. data/lib/forgejo/models/api_unauthorized_error.rb +229 -0
  80. data/lib/forgejo/models/api_validation_error.rb +229 -0
  81. data/lib/forgejo/models/attachment.rb +55 -6
  82. data/lib/forgejo/models/blocked_user.rb +11 -5
  83. data/lib/forgejo/models/branch.rb +11 -5
  84. data/lib/forgejo/models/branch_protection.rb +11 -5
  85. data/lib/forgejo/models/change_file_operation.rb +21 -5
  86. data/lib/forgejo/models/change_files_options.rb +21 -5
  87. data/lib/forgejo/models/changed_file.rb +11 -5
  88. data/lib/forgejo/models/combined_status.rb +11 -5
  89. data/lib/forgejo/models/comment.rb +11 -5
  90. data/lib/forgejo/models/commit.rb +11 -5
  91. data/lib/forgejo/models/commit_affected_files.rb +11 -5
  92. data/lib/forgejo/models/commit_date_options.rb +11 -5
  93. data/lib/forgejo/models/commit_meta.rb +11 -5
  94. data/lib/forgejo/models/commit_stats.rb +11 -5
  95. data/lib/forgejo/models/commit_status.rb +11 -5
  96. data/lib/forgejo/models/commit_user.rb +11 -5
  97. data/lib/forgejo/models/compare.rb +11 -5
  98. data/lib/forgejo/models/contents_response.rb +11 -5
  99. data/lib/forgejo/models/create_access_token_option.rb +21 -5
  100. data/lib/forgejo/models/create_branch_protection_option.rb +11 -5
  101. data/lib/forgejo/models/create_branch_repo_option.rb +21 -5
  102. data/lib/forgejo/models/create_email_option.rb +11 -5
  103. data/lib/forgejo/models/create_file_options.rb +21 -5
  104. data/lib/forgejo/models/create_fork_option.rb +11 -5
  105. data/lib/forgejo/models/create_gpg_key_option.rb +21 -5
  106. data/lib/forgejo/models/create_hook_option.rb +21 -5
  107. data/lib/forgejo/models/create_issue_comment_option.rb +21 -5
  108. data/lib/forgejo/models/create_issue_option.rb +21 -5
  109. data/lib/forgejo/models/create_key_option.rb +31 -5
  110. data/lib/forgejo/models/create_label_option.rb +31 -5
  111. data/lib/forgejo/models/create_milestone_option.rb +11 -5
  112. data/lib/forgejo/models/create_o_auth2_application_options.rb +11 -5
  113. data/lib/forgejo/models/create_or_update_secret_option.rb +21 -5
  114. data/lib/forgejo/models/create_org_option.rb +21 -5
  115. data/lib/forgejo/models/create_pull_request_option.rb +11 -5
  116. data/lib/forgejo/models/create_pull_review_comment.rb +11 -5
  117. data/lib/forgejo/models/create_pull_review_options.rb +11 -5
  118. data/lib/forgejo/models/create_push_mirror_option.rb +24 -9
  119. data/lib/forgejo/models/create_quota_group_options.rb +234 -0
  120. data/lib/forgejo/models/create_quota_rule_options.rb +244 -0
  121. data/lib/forgejo/models/create_release_option.rb +21 -5
  122. data/lib/forgejo/models/create_repo_option.rb +21 -5
  123. data/lib/forgejo/models/create_status_option.rb +11 -5
  124. data/lib/forgejo/models/create_tag_option.rb +21 -5
  125. data/lib/forgejo/models/create_tag_protection_option.rb +11 -5
  126. data/lib/forgejo/models/create_team_option.rb +21 -5
  127. data/lib/forgejo/models/create_user_option.rb +31 -5
  128. data/lib/forgejo/models/create_variable_option.rb +21 -5
  129. data/lib/forgejo/models/create_wiki_page_options.rb +11 -5
  130. data/lib/forgejo/models/cron.rb +11 -5
  131. data/lib/forgejo/models/delete_email_option.rb +11 -5
  132. data/lib/forgejo/models/delete_file_options.rb +21 -5
  133. data/lib/forgejo/models/delete_labels_option.rb +11 -5
  134. data/lib/forgejo/models/deploy_key.rb +11 -5
  135. data/lib/forgejo/models/dismiss_pull_review_options.rb +11 -5
  136. data/lib/forgejo/models/dispatch_workflow_option.rb +21 -5
  137. data/lib/forgejo/models/edit_attachment_options.rb +22 -6
  138. data/lib/forgejo/models/edit_branch_protection_option.rb +11 -5
  139. data/lib/forgejo/models/edit_deadline_option.rb +21 -5
  140. data/lib/forgejo/models/edit_git_hook_option.rb +11 -5
  141. data/lib/forgejo/models/edit_hook_option.rb +11 -5
  142. data/lib/forgejo/models/edit_issue_comment_option.rb +21 -5
  143. data/lib/forgejo/models/edit_issue_option.rb +11 -5
  144. data/lib/forgejo/models/edit_label_option.rb +11 -5
  145. data/lib/forgejo/models/edit_milestone_option.rb +11 -5
  146. data/lib/forgejo/models/edit_org_option.rb +11 -5
  147. data/lib/forgejo/models/edit_pull_request_option.rb +11 -5
  148. data/lib/forgejo/models/edit_quota_rule_options.rb +234 -0
  149. data/lib/forgejo/models/edit_reaction_option.rb +11 -5
  150. data/lib/forgejo/models/edit_release_option.rb +11 -5
  151. data/lib/forgejo/models/edit_repo_option.rb +22 -6
  152. data/lib/forgejo/models/edit_tag_protection_option.rb +11 -5
  153. data/lib/forgejo/models/edit_team_option.rb +21 -5
  154. data/lib/forgejo/models/edit_user_option.rb +11 -5
  155. data/lib/forgejo/models/email.rb +11 -5
  156. data/lib/forgejo/models/external_tracker.rb +11 -5
  157. data/lib/forgejo/models/external_wiki.rb +11 -5
  158. data/lib/forgejo/models/file_commit_response.rb +11 -5
  159. data/lib/forgejo/models/file_delete_response.rb +11 -5
  160. data/lib/forgejo/models/file_links_response.rb +11 -5
  161. data/lib/forgejo/models/file_response.rb +11 -5
  162. data/lib/forgejo/models/files_response.rb +11 -5
  163. data/lib/forgejo/models/general_api_settings.rb +11 -5
  164. data/lib/forgejo/models/general_attachment_settings.rb +11 -5
  165. data/lib/forgejo/models/general_repo_settings.rb +11 -5
  166. data/lib/forgejo/models/general_ui_settings.rb +11 -5
  167. data/lib/forgejo/models/generate_repo_option.rb +31 -5
  168. data/lib/forgejo/models/git_blob_response.rb +11 -5
  169. data/lib/forgejo/models/git_entry.rb +11 -5
  170. data/lib/forgejo/models/git_hook.rb +11 -5
  171. data/lib/forgejo/models/git_object.rb +11 -5
  172. data/lib/forgejo/models/git_tree_response.rb +11 -5
  173. data/lib/forgejo/models/gitignore_template_info.rb +11 -5
  174. data/lib/forgejo/models/gpg_key.rb +11 -5
  175. data/lib/forgejo/models/gpg_key_email.rb +11 -5
  176. data/lib/forgejo/models/hook.rb +11 -5
  177. data/lib/forgejo/models/identity.rb +11 -5
  178. data/lib/forgejo/models/internal_tracker.rb +11 -5
  179. data/lib/forgejo/models/issue.rb +11 -5
  180. data/lib/forgejo/models/issue_config.rb +11 -5
  181. data/lib/forgejo/models/issue_config_contact_link.rb +11 -5
  182. data/lib/forgejo/models/issue_config_validation.rb +11 -5
  183. data/lib/forgejo/models/issue_deadline.rb +11 -5
  184. data/lib/forgejo/models/issue_form_field.rb +11 -5
  185. data/lib/forgejo/models/issue_labels_option.rb +11 -5
  186. data/lib/forgejo/models/issue_meta.rb +11 -5
  187. data/lib/forgejo/models/issue_template.rb +11 -5
  188. data/lib/forgejo/models/label.rb +11 -5
  189. data/lib/forgejo/models/label_template.rb +11 -5
  190. data/lib/forgejo/models/license_template_info.rb +11 -5
  191. data/lib/forgejo/models/licenses_template_list_entry.rb +11 -5
  192. data/lib/forgejo/models/markdown_option.rb +11 -5
  193. data/lib/forgejo/models/markup_option.rb +22 -6
  194. data/lib/forgejo/models/merge_pull_request_option.rb +11 -5
  195. data/lib/forgejo/models/migrate_repo_options.rb +31 -5
  196. data/lib/forgejo/models/milestone.rb +11 -5
  197. data/lib/forgejo/models/new_issue_pins_allowed.rb +11 -5
  198. data/lib/forgejo/models/node_info.rb +11 -5
  199. data/lib/forgejo/models/node_info_services.rb +11 -5
  200. data/lib/forgejo/models/node_info_software.rb +11 -5
  201. data/lib/forgejo/models/node_info_usage.rb +11 -5
  202. data/lib/forgejo/models/node_info_usage_users.rb +11 -5
  203. data/lib/forgejo/models/note.rb +11 -5
  204. data/lib/forgejo/models/note_options.rb +220 -0
  205. data/lib/forgejo/models/notification_count.rb +11 -5
  206. data/lib/forgejo/models/notification_subject.rb +11 -5
  207. data/lib/forgejo/models/notification_thread.rb +11 -5
  208. data/lib/forgejo/models/o_auth2_application.rb +11 -5
  209. data/lib/forgejo/models/organization.rb +11 -5
  210. data/lib/forgejo/models/organization_permissions.rb +11 -5
  211. data/lib/forgejo/models/package.rb +11 -5
  212. data/lib/forgejo/models/package_file.rb +11 -5
  213. data/lib/forgejo/models/payload_commit.rb +11 -5
  214. data/lib/forgejo/models/payload_commit_verification.rb +11 -5
  215. data/lib/forgejo/models/payload_user.rb +11 -5
  216. data/lib/forgejo/models/permission.rb +11 -5
  217. data/lib/forgejo/models/pr_branch_info.rb +11 -5
  218. data/lib/forgejo/models/public_key.rb +11 -5
  219. data/lib/forgejo/models/pull_request.rb +23 -6
  220. data/lib/forgejo/models/pull_request_meta.rb +11 -5
  221. data/lib/forgejo/models/pull_review.rb +11 -5
  222. data/lib/forgejo/models/pull_review_comment.rb +11 -5
  223. data/lib/forgejo/models/pull_review_request_options.rb +11 -5
  224. data/lib/forgejo/models/push_mirror.rb +21 -6
  225. data/lib/forgejo/models/quota_group.rb +234 -0
  226. data/lib/forgejo/models/quota_info.rb +233 -0
  227. data/lib/forgejo/models/quota_rule_info.rb +244 -0
  228. data/lib/forgejo/models/quota_used.rb +221 -0
  229. data/lib/forgejo/models/quota_used_artifact.rb +242 -0
  230. data/lib/forgejo/models/quota_used_attachment.rb +251 -0
  231. data/lib/forgejo/models/quota_used_attachment_contained_in.rb +232 -0
  232. data/lib/forgejo/models/quota_used_package.rb +262 -0
  233. data/lib/forgejo/models/quota_used_size.rb +239 -0
  234. data/lib/forgejo/models/quota_used_size_assets.rb +240 -0
  235. data/lib/forgejo/models/quota_used_size_assets_attachments.rb +232 -0
  236. data/lib/forgejo/models/quota_used_size_assets_packages.rb +222 -0
  237. data/lib/forgejo/models/quota_used_size_git.rb +222 -0
  238. data/lib/forgejo/models/quota_used_size_repos.rb +232 -0
  239. data/lib/forgejo/models/reaction.rb +11 -5
  240. data/lib/forgejo/models/reference.rb +11 -5
  241. data/lib/forgejo/models/release.rb +11 -5
  242. data/lib/forgejo/models/rename_user_option.rb +21 -5
  243. data/lib/forgejo/models/replace_flags_option.rb +11 -5
  244. data/lib/forgejo/models/repo_collaborator_permission.rb +11 -5
  245. data/lib/forgejo/models/repo_commit.rb +11 -5
  246. data/lib/forgejo/models/repo_create_release_attachment_request.rb +26 -10
  247. data/lib/forgejo/models/repo_topic_options.rb +11 -5
  248. data/lib/forgejo/models/repo_transfer.rb +11 -5
  249. data/lib/forgejo/models/repository.rb +21 -6
  250. data/lib/forgejo/models/repository_meta.rb +11 -5
  251. data/lib/forgejo/models/search_results.rb +11 -5
  252. data/lib/forgejo/models/secret.rb +11 -5
  253. data/lib/forgejo/models/server_version.rb +11 -5
  254. data/lib/forgejo/models/set_user_quota_groups_options.rb +241 -0
  255. data/lib/forgejo/models/stop_watch.rb +11 -5
  256. data/lib/forgejo/models/submit_pull_review_options.rb +11 -5
  257. data/lib/forgejo/models/tag.rb +11 -5
  258. data/lib/forgejo/models/tag_archive_download_count.rb +11 -5
  259. data/lib/forgejo/models/tag_protection.rb +11 -5
  260. data/lib/forgejo/models/team.rb +11 -5
  261. data/lib/forgejo/models/team_search200_response.rb +11 -5
  262. data/lib/forgejo/models/timeline_comment.rb +11 -5
  263. data/lib/forgejo/models/topic_name.rb +11 -5
  264. data/lib/forgejo/models/topic_response.rb +11 -5
  265. data/lib/forgejo/models/tracked_time.rb +11 -5
  266. data/lib/forgejo/models/transfer_repo_option.rb +21 -5
  267. data/lib/forgejo/models/update_branch_repo_option.rb +239 -0
  268. data/lib/forgejo/models/update_file_options.rb +31 -5
  269. data/lib/forgejo/models/update_repo_avatar_option.rb +11 -5
  270. data/lib/forgejo/models/update_user_avatar_option.rb +11 -5
  271. data/lib/forgejo/models/update_variable_option.rb +21 -5
  272. data/lib/forgejo/models/user.rb +11 -5
  273. data/lib/forgejo/models/user_heatmap_data.rb +11 -5
  274. data/lib/forgejo/models/user_search200_response.rb +11 -5
  275. data/lib/forgejo/models/user_settings.rb +11 -5
  276. data/lib/forgejo/models/user_settings_options.rb +11 -5
  277. data/lib/forgejo/models/watch_info.rb +11 -5
  278. data/lib/forgejo/models/wiki_commit.rb +11 -5
  279. data/lib/forgejo/models/wiki_commit_list.rb +11 -5
  280. data/lib/forgejo/models/wiki_page.rb +11 -5
  281. data/lib/forgejo/models/wiki_page_meta_data.rb +11 -5
  282. data/lib/forgejo/version.rb +3 -3
  283. data/lib/forgejo.rb +28 -2
  284. data/manifest.scm +6 -2
  285. data/openapi-generator-cli.jar +0 -0
  286. data/pom.xml~ +22 -0
  287. data/smoke +1 -1
  288. data/spec/models/api_forbidden_error_spec.rb +42 -0
  289. data/spec/models/api_invalid_topics_error_spec.rb +42 -0
  290. data/spec/models/api_not_found_spec.rb +48 -0
  291. data/spec/models/api_repo_archived_error_spec.rb +42 -0
  292. data/spec/models/api_unauthorized_error_spec.rb +42 -0
  293. data/spec/models/api_validation_error_spec.rb +42 -0
  294. data/spec/models/create_quota_group_options_spec.rb +42 -0
  295. data/spec/models/create_quota_rule_options_spec.rb +48 -0
  296. data/spec/models/edit_quota_rule_options_spec.rb +42 -0
  297. data/spec/models/note_options_spec.rb +36 -0
  298. data/spec/models/quota_group_spec.rb +42 -0
  299. data/spec/models/quota_info_spec.rb +42 -0
  300. data/spec/models/quota_rule_info_spec.rb +48 -0
  301. data/spec/models/quota_used_artifact_spec.rb +48 -0
  302. data/spec/models/quota_used_attachment_contained_in_spec.rb +42 -0
  303. data/spec/models/quota_used_attachment_spec.rb +54 -0
  304. data/spec/models/quota_used_package_spec.rb +60 -0
  305. data/spec/models/quota_used_size_assets_attachments_spec.rb +42 -0
  306. data/spec/models/quota_used_size_assets_packages_spec.rb +36 -0
  307. data/spec/models/quota_used_size_assets_spec.rb +48 -0
  308. data/spec/models/quota_used_size_git_spec.rb +36 -0
  309. data/spec/models/quota_used_size_repos_spec.rb +42 -0
  310. data/spec/models/quota_used_size_spec.rb +48 -0
  311. data/spec/models/quota_used_spec.rb +36 -0
  312. data/spec/models/set_user_quota_groups_options_spec.rb +36 -0
  313. data/spec/models/update_branch_repo_option_spec.rb +36 -0
  314. data/spec/spec_helper.rb +2 -2
  315. data/swagger.v1.json +2563 -338
  316. data/swagger.v1.patched.json +1 -1
  317. metadata +291 -182
  318. data/LICENSE~ +0 -9
  319. data/Makefile~ +0 -2
  320. data/patch~ +0 -1
  321. data/smoke~ +0 -1
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Forgejo API
3
+
4
+ #This documentation describes the Forgejo API.
5
+
6
+ The version of the OpenAPI document: 10.0.0-121-28886cd+gitea-1.22.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Forgejo
17
+ # CreateQutaGroupOptions represents the options for creating a quota group
18
+ class CreateQuotaGroupOptions
19
+ # Name of the quota group to create
20
+ attr_accessor :name
21
+
22
+ # Rules to add to the newly created group. If a rule does not exist, it will be created.
23
+ attr_accessor :rules
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'name' => :'name',
29
+ :'rules' => :'rules'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'name' => :'String',
47
+ :'rules' => :'Array<CreateQuotaRuleOptions>'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Forgejo::CreateQuotaGroupOptions` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateQuotaGroupOptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'name')
74
+ self.name = attributes[:'name']
75
+ end
76
+
77
+ if attributes.key?(:'rules')
78
+ if (value = attributes[:'rules']).is_a?(Array)
79
+ self.rules = value
80
+ end
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ warn '[DEPRECATED] the `valid?` method is obsolete'
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ name == o.name &&
105
+ rules == o.rules
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [name, rules].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ transformed_hash = {}
127
+ openapi_types.each_pair do |key, type|
128
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = nil
130
+ elsif type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[attribute_map[key]].is_a?(Array)
134
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
135
+ end
136
+ elsif !attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
138
+ end
139
+ end
140
+ new(transformed_hash)
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def self._deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = Forgejo.const_get(type)
182
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #Forgejo API
3
+
4
+ #This documentation describes the Forgejo API.
5
+
6
+ The version of the OpenAPI document: 10.0.0-121-28886cd+gitea-1.22.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Forgejo
17
+ # CreateQuotaRuleOptions represents the options for creating a quota rule
18
+ class CreateQuotaRuleOptions
19
+ # The limit set by the rule
20
+ attr_accessor :limit
21
+
22
+ # Name of the rule to create
23
+ attr_accessor :name
24
+
25
+ # The subjects affected by the rule
26
+ attr_accessor :subjects
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'limit' => :'limit',
32
+ :'name' => :'name',
33
+ :'subjects' => :'subjects'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'limit' => :'Integer',
51
+ :'name' => :'String',
52
+ :'subjects' => :'Array<String>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Forgejo::CreateQuotaRuleOptions` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateQuotaRuleOptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'limit')
79
+ self.limit = attributes[:'limit']
80
+ end
81
+
82
+ if attributes.key?(:'name')
83
+ self.name = attributes[:'name']
84
+ end
85
+
86
+ if attributes.key?(:'subjects')
87
+ if (value = attributes[:'subjects']).is_a?(Array)
88
+ self.subjects = value
89
+ end
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ limit == o.limit &&
114
+ name == o.name &&
115
+ subjects == o.subjects
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [limit, name, subjects].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ attributes = attributes.transform_keys(&:to_sym)
136
+ transformed_hash = {}
137
+ openapi_types.each_pair do |key, type|
138
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
139
+ transformed_hash["#{key}"] = nil
140
+ elsif type =~ /\AArray<(.*)>/i
141
+ # check to ensure the input is an array given that the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[attribute_map[key]].is_a?(Array)
144
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
145
+ end
146
+ elsif !attributes[attribute_map[key]].nil?
147
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
148
+ end
149
+ end
150
+ new(transformed_hash)
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def self._deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = Forgejo.const_get(type)
192
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -3,10 +3,10 @@
3
3
 
4
4
  #This documentation describes the Forgejo API.
5
5
 
6
- The version of the OpenAPI document: 8.0.3-53-9d5cce4bcc+gitea-1.22.0
6
+ The version of the OpenAPI document: 10.0.0-121-28886cd+gitea-1.22.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -43,9 +43,14 @@ module Forgejo
43
43
  }
44
44
  end
45
45
 
46
+ # Returns attribute mapping this model knows about
47
+ def self.acceptable_attribute_map
48
+ attribute_map
49
+ end
50
+
46
51
  # Returns all the JSON keys this model knows about
47
52
  def self.acceptable_attributes
48
- attribute_map.values
53
+ acceptable_attribute_map.values
49
54
  end
50
55
 
51
56
  # Attribute type mapping.
@@ -75,9 +80,10 @@ module Forgejo
75
80
  end
76
81
 
77
82
  # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
78
84
  attributes = attributes.each_with_object({}) { |(k, v), h|
79
- if (!self.class.attribute_map.key?(k.to_sym))
80
- fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateReleaseOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateReleaseOption`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
81
87
  end
82
88
  h[k.to_sym] = v
83
89
  }
@@ -133,6 +139,16 @@ module Forgejo
133
139
  true
134
140
  end
135
141
 
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] tag_name Value to be assigned
144
+ def tag_name=(tag_name)
145
+ if tag_name.nil?
146
+ fail ArgumentError, 'tag_name cannot be nil'
147
+ end
148
+
149
+ @tag_name = tag_name
150
+ end
151
+
136
152
  # Checks equality by comparing each attribute.
137
153
  # @param [Object] Object to be compared
138
154
  def ==(o)
@@ -3,10 +3,10 @@
3
3
 
4
4
  #This documentation describes the Forgejo API.
5
5
 
6
- The version of the OpenAPI document: 8.0.3-53-9d5cce4bcc+gitea-1.22.0
6
+ The version of the OpenAPI document: 10.0.0-121-28886cd+gitea-1.22.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -92,9 +92,14 @@ module Forgejo
92
92
  }
93
93
  end
94
94
 
95
+ # Returns attribute mapping this model knows about
96
+ def self.acceptable_attribute_map
97
+ attribute_map
98
+ end
99
+
95
100
  # Returns all the JSON keys this model knows about
96
101
  def self.acceptable_attributes
97
- attribute_map.values
102
+ acceptable_attribute_map.values
98
103
  end
99
104
 
100
105
  # Attribute type mapping.
@@ -129,9 +134,10 @@ module Forgejo
129
134
  end
130
135
 
131
136
  # check to see if the attribute exists and convert string to symbol for hash key
137
+ acceptable_attribute_map = self.class.acceptable_attribute_map
132
138
  attributes = attributes.each_with_object({}) { |(k, v), h|
133
- if (!self.class.attribute_map.key?(k.to_sym))
134
- fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateRepoOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
139
+ if (!acceptable_attribute_map.key?(k.to_sym))
140
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateRepoOption`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
135
141
  end
136
142
  h[k.to_sym] = v
137
143
  }
@@ -211,6 +217,16 @@ module Forgejo
211
217
  true
212
218
  end
213
219
 
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] name Value to be assigned
222
+ def name=(name)
223
+ if name.nil?
224
+ fail ArgumentError, 'name cannot be nil'
225
+ end
226
+
227
+ @name = name
228
+ end
229
+
214
230
  # Custom attribute writer method checking allowed values (enum).
215
231
  # @param [Object] object_format_name Object to be assigned
216
232
  def object_format_name=(object_format_name)
@@ -3,10 +3,10 @@
3
3
 
4
4
  #This documentation describes the Forgejo API.
5
5
 
6
- The version of the OpenAPI document: 8.0.3-53-9d5cce4bcc+gitea-1.22.0
6
+ The version of the OpenAPI document: 10.0.0-121-28886cd+gitea-1.22.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -35,9 +35,14 @@ module Forgejo
35
35
  }
36
36
  end
37
37
 
38
+ # Returns attribute mapping this model knows about
39
+ def self.acceptable_attribute_map
40
+ attribute_map
41
+ end
42
+
38
43
  # Returns all the JSON keys this model knows about
39
44
  def self.acceptable_attributes
40
- attribute_map.values
45
+ acceptable_attribute_map.values
41
46
  end
42
47
 
43
48
  # Attribute type mapping.
@@ -64,9 +69,10 @@ module Forgejo
64
69
  end
65
70
 
66
71
  # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
73
  attributes = attributes.each_with_object({}) { |(k, v), h|
68
- if (!self.class.attribute_map.key?(k.to_sym))
69
- fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateStatusOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateStatusOption`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
76
  end
71
77
  h[k.to_sym] = v
72
78
  }
@@ -3,10 +3,10 @@
3
3
 
4
4
  #This documentation describes the Forgejo API.
5
5
 
6
- The version of the OpenAPI document: 8.0.3-53-9d5cce4bcc+gitea-1.22.0
6
+ The version of the OpenAPI document: 10.0.0-121-28886cd+gitea-1.22.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -31,9 +31,14 @@ module Forgejo
31
31
  }
32
32
  end
33
33
 
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
34
39
  # Returns all the JSON keys this model knows about
35
40
  def self.acceptable_attributes
36
- attribute_map.values
41
+ acceptable_attribute_map.values
37
42
  end
38
43
 
39
44
  # Attribute type mapping.
@@ -59,9 +64,10 @@ module Forgejo
59
64
  end
60
65
 
61
66
  # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
62
68
  attributes = attributes.each_with_object({}) { |(k, v), h|
63
- if (!self.class.attribute_map.key?(k.to_sym))
64
- fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateTagOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::CreateTagOption`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
65
71
  end
66
72
  h[k.to_sym] = v
67
73
  }
@@ -101,6 +107,16 @@ module Forgejo
101
107
  true
102
108
  end
103
109
 
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] tag_name Value to be assigned
112
+ def tag_name=(tag_name)
113
+ if tag_name.nil?
114
+ fail ArgumentError, 'tag_name cannot be nil'
115
+ end
116
+
117
+ @tag_name = tag_name
118
+ end
119
+
104
120
  # Checks equality by comparing each attribute.
105
121
  # @param [Object] Object to be compared
106
122
  def ==(o)