forgejo 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +9 -0
- data/LICENSE~ +9 -0
- data/Makefile +23 -0
- data/Makefile~ +2 -0
- data/README.md +717 -0
- data/Rakefile +10 -0
- data/docs/APIError.md +20 -0
- data/docs/AccessToken.md +26 -0
- data/docs/ActionTask.md +42 -0
- data/docs/ActionTaskResponse.md +20 -0
- data/docs/ActionVariable.md +24 -0
- data/docs/Activity.md +42 -0
- data/docs/ActivityPub.md +18 -0
- data/docs/ActivitypubApi.md +289 -0
- data/docs/AddCollaboratorOption.md +18 -0
- data/docs/AddTimeOption.md +22 -0
- data/docs/AdminApi.md +1672 -0
- data/docs/AnnotatedTag.md +32 -0
- data/docs/AnnotatedTagObject.md +22 -0
- data/docs/Attachment.md +30 -0
- data/docs/BlockedUser.md +20 -0
- data/docs/Branch.md +34 -0
- data/docs/BranchProtection.md +70 -0
- data/docs/ChangeFileOperation.md +26 -0
- data/docs/ChangeFilesOptions.md +32 -0
- data/docs/ChangedFile.md +34 -0
- data/docs/CombinedStatus.md +30 -0
- data/docs/Comment.md +38 -0
- data/docs/Commit.md +36 -0
- data/docs/CommitAffectedFiles.md +20 -0
- data/docs/CommitDateOptions.md +20 -0
- data/docs/CommitMeta.md +22 -0
- data/docs/CommitStats.md +22 -0
- data/docs/CommitStatus.md +34 -0
- data/docs/CommitUser.md +22 -0
- data/docs/Compare.md +20 -0
- data/docs/ContentsResponse.md +46 -0
- data/docs/CreateAccessTokenOption.md +20 -0
- data/docs/CreateBranchProtectionOption.md +66 -0
- data/docs/CreateBranchRepoOption.md +22 -0
- data/docs/CreateEmailOption.md +18 -0
- data/docs/CreateFileOptions.md +32 -0
- data/docs/CreateForkOption.md +20 -0
- data/docs/CreateGPGKeyOption.md +20 -0
- data/docs/CreateHookOption.md +28 -0
- data/docs/CreateIssueCommentOption.md +20 -0
- data/docs/CreateIssueOption.md +34 -0
- data/docs/CreateKeyOption.md +22 -0
- data/docs/CreateLabelOption.md +26 -0
- data/docs/CreateMilestoneOption.md +24 -0
- data/docs/CreateOAuth2ApplicationOptions.md +22 -0
- data/docs/CreateOrUpdateSecretOption.md +18 -0
- data/docs/CreateOrgOption.md +32 -0
- data/docs/CreatePullRequestOption.md +34 -0
- data/docs/CreatePullReviewComment.md +24 -0
- data/docs/CreatePullReviewOptions.md +24 -0
- data/docs/CreatePushMirrorOption.md +26 -0
- data/docs/CreateReleaseOption.md +30 -0
- data/docs/CreateRepoOption.md +40 -0
- data/docs/CreateStatusOption.md +24 -0
- data/docs/CreateTagOption.md +22 -0
- data/docs/CreateTagProtectionOption.md +22 -0
- data/docs/CreateTeamOption.md +30 -0
- data/docs/CreateUserOption.md +38 -0
- data/docs/CreateVariableOption.md +18 -0
- data/docs/CreateWikiPageOptions.md +22 -0
- data/docs/Cron.md +26 -0
- data/docs/DeleteEmailOption.md +18 -0
- data/docs/DeleteFileOptions.md +32 -0
- data/docs/DeleteLabelsOption.md +18 -0
- data/docs/DeployKey.md +34 -0
- data/docs/DismissPullReviewOptions.md +20 -0
- data/docs/DispatchWorkflowOption.md +20 -0
- data/docs/EditAttachmentOptions.md +18 -0
- data/docs/EditBranchProtectionOption.md +62 -0
- data/docs/EditDeadlineOption.md +18 -0
- data/docs/EditGitHookOption.md +18 -0
- data/docs/EditHookOption.md +26 -0
- data/docs/EditIssueCommentOption.md +20 -0
- data/docs/EditIssueOption.md +36 -0
- data/docs/EditLabelOption.md +26 -0
- data/docs/EditMilestoneOption.md +24 -0
- data/docs/EditOrgOption.md +30 -0
- data/docs/EditPullRequestOption.md +38 -0
- data/docs/EditReactionOption.md +18 -0
- data/docs/EditReleaseOption.md +30 -0
- data/docs/EditRepoOption.md +82 -0
- data/docs/EditTagProtectionOption.md +22 -0
- data/docs/EditTeamOption.md +30 -0
- data/docs/EditUserOption.md +54 -0
- data/docs/Email.md +26 -0
- data/docs/ExternalTracker.md +24 -0
- data/docs/ExternalWiki.md +18 -0
- data/docs/FileCommitResponse.md +34 -0
- data/docs/FileDeleteResponse.md +22 -0
- data/docs/FileLinksResponse.md +22 -0
- data/docs/FileResponse.md +22 -0
- data/docs/FilesResponse.md +22 -0
- data/docs/GPGKey.md +42 -0
- data/docs/GPGKeyEmail.md +20 -0
- data/docs/GeneralAPISettings.md +24 -0
- data/docs/GeneralAttachmentSettings.md +24 -0
- data/docs/GeneralRepoSettings.md +30 -0
- data/docs/GeneralUISettings.md +22 -0
- data/docs/GenerateRepoOption.md +40 -0
- data/docs/GitBlobResponse.md +26 -0
- data/docs/GitEntry.md +28 -0
- data/docs/GitHook.md +22 -0
- data/docs/GitObject.md +22 -0
- data/docs/GitTreeResponse.md +28 -0
- data/docs/GitignoreTemplateInfo.md +20 -0
- data/docs/Hook.md +40 -0
- data/docs/Identity.md +20 -0
- data/docs/InternalTracker.md +22 -0
- data/docs/Issue.md +66 -0
- data/docs/IssueApi.md +5206 -0
- data/docs/IssueConfig.md +20 -0
- data/docs/IssueConfigContactLink.md +22 -0
- data/docs/IssueConfigValidation.md +20 -0
- data/docs/IssueDeadline.md +18 -0
- data/docs/IssueFormField.md +26 -0
- data/docs/IssueLabelsOption.md +20 -0
- data/docs/IssueMeta.md +22 -0
- data/docs/IssueTemplate.md +32 -0
- data/docs/Label.md +30 -0
- data/docs/LabelTemplate.md +24 -0
- data/docs/LicenseTemplateInfo.md +26 -0
- data/docs/LicensesTemplateListEntry.md +22 -0
- data/docs/MarkdownOption.md +24 -0
- data/docs/MarkupOption.md +26 -0
- data/docs/MergePullRequestOption.md +32 -0
- data/docs/MigrateRepoOptions.md +56 -0
- data/docs/Milestone.md +36 -0
- data/docs/MiscellaneousApi.md +833 -0
- data/docs/NewIssuePinsAllowed.md +20 -0
- data/docs/NodeInfo.md +30 -0
- data/docs/NodeInfoServices.md +20 -0
- data/docs/NodeInfoSoftware.md +24 -0
- data/docs/NodeInfoUsage.md +22 -0
- data/docs/NodeInfoUsageUsers.md +22 -0
- data/docs/Note.md +20 -0
- data/docs/NotificationApi.md +550 -0
- data/docs/NotificationCount.md +18 -0
- data/docs/NotificationSubject.md +30 -0
- data/docs/NotificationThread.md +30 -0
- data/docs/OAuth2Application.md +30 -0
- data/docs/Organization.md +38 -0
- data/docs/OrganizationApi.md +4259 -0
- data/docs/OrganizationPermissions.md +26 -0
- data/docs/PRBranchInfo.md +26 -0
- data/docs/Package.md +34 -0
- data/docs/PackageApi.md +314 -0
- data/docs/PackageFile.md +30 -0
- data/docs/PayloadCommit.md +36 -0
- data/docs/PayloadCommitVerification.md +26 -0
- data/docs/PayloadUser.md +22 -0
- data/docs/Permission.md +22 -0
- data/docs/PublicKey.md +34 -0
- data/docs/PullRequest.md +88 -0
- data/docs/PullRequestMeta.md +24 -0
- data/docs/PullReview.md +44 -0
- data/docs/PullReviewComment.md +46 -0
- data/docs/PullReviewRequestOptions.md +20 -0
- data/docs/PushMirror.md +32 -0
- data/docs/Reaction.md +22 -0
- data/docs/Reference.md +22 -0
- data/docs/Release.md +52 -0
- data/docs/RenameUserOption.md +18 -0
- data/docs/ReplaceFlagsOption.md +18 -0
- data/docs/RepoCollaboratorPermission.md +22 -0
- data/docs/RepoCommit.md +28 -0
- data/docs/RepoCreateReleaseAttachmentRequest.md +18 -0
- data/docs/RepoTopicOptions.md +18 -0
- data/docs/RepoTransfer.md +22 -0
- data/docs/Repository.md +140 -0
- data/docs/RepositoryApi.md +13022 -0
- data/docs/RepositoryMeta.md +24 -0
- data/docs/SearchResults.md +20 -0
- data/docs/Secret.md +20 -0
- data/docs/ServerVersion.md +18 -0
- data/docs/SettingsApi.md +275 -0
- data/docs/StopWatch.md +30 -0
- data/docs/SubmitPullReviewOptions.md +20 -0
- data/docs/Tag.md +30 -0
- data/docs/TagArchiveDownloadCount.md +20 -0
- data/docs/TagProtection.md +28 -0
- data/docs/Team.md +34 -0
- data/docs/TeamSearch200Response.md +20 -0
- data/docs/TimelineComment.md +74 -0
- data/docs/TopicName.md +18 -0
- data/docs/TopicResponse.md +26 -0
- data/docs/TrackedTime.md +30 -0
- data/docs/TransferRepoOption.md +20 -0
- data/docs/UpdateFileOptions.md +36 -0
- data/docs/UpdateRepoAvatarOption.md +18 -0
- data/docs/UpdateUserAvatarOption.md +18 -0
- data/docs/UpdateVariableOption.md +20 -0
- data/docs/User.md +62 -0
- data/docs/UserApi.md +4969 -0
- data/docs/UserHeatmapData.md +20 -0
- data/docs/UserSearch200Response.md +20 -0
- data/docs/UserSettings.md +38 -0
- data/docs/UserSettingsOptions.md +38 -0
- data/docs/WatchInfo.md +28 -0
- data/docs/WikiCommit.md +24 -0
- data/docs/WikiCommitList.md +20 -0
- data/docs/WikiPage.md +32 -0
- data/docs/WikiPageMetaData.md +24 -0
- data/forgejo.gemspec +49 -0
- data/git_push.sh +57 -0
- data/lib/forgejo/api/activitypub_api.rb +269 -0
- data/lib/forgejo/api/admin_api.rb +1496 -0
- data/lib/forgejo/api/issue_api.rb +5282 -0
- data/lib/forgejo/api/miscellaneous_api.rb +725 -0
- data/lib/forgejo/api/notification_api.rb +520 -0
- data/lib/forgejo/api/organization_api.rb +3898 -0
- data/lib/forgejo/api/package_api.rb +334 -0
- data/lib/forgejo/api/repository_api.rb +12849 -0
- data/lib/forgejo/api/settings_api.rb +242 -0
- data/lib/forgejo/api/user_api.rb +4314 -0
- data/lib/forgejo/api_client.rb +437 -0
- data/lib/forgejo/api_error.rb +58 -0
- data/lib/forgejo/configuration.rb +392 -0
- data/lib/forgejo/models/access_token.rb +252 -0
- data/lib/forgejo/models/action_task.rb +323 -0
- data/lib/forgejo/models/action_task_response.rb +226 -0
- data/lib/forgejo/models/action_variable.rb +246 -0
- data/lib/forgejo/models/activity.rb +357 -0
- data/lib/forgejo/models/activity_pub.rb +215 -0
- data/lib/forgejo/models/add_collaborator_option.rb +215 -0
- data/lib/forgejo/models/add_time_option.rb +242 -0
- data/lib/forgejo/models/annotated_tag.rb +278 -0
- data/lib/forgejo/models/annotated_tag_object.rb +233 -0
- data/lib/forgejo/models/api_error.rb +224 -0
- data/lib/forgejo/models/attachment.rb +269 -0
- data/lib/forgejo/models/blocked_user.rb +223 -0
- data/lib/forgejo/models/branch.rb +289 -0
- data/lib/forgejo/models/branch_protection.rb +464 -0
- data/lib/forgejo/models/change_file_operation.rb +304 -0
- data/lib/forgejo/models/change_files_options.rb +292 -0
- data/lib/forgejo/models/changed_file.rb +287 -0
- data/lib/forgejo/models/combined_status.rb +272 -0
- data/lib/forgejo/models/comment.rb +307 -0
- data/lib/forgejo/models/commit.rb +299 -0
- data/lib/forgejo/models/commit_affected_files.rb +224 -0
- data/lib/forgejo/models/commit_date_options.rb +224 -0
- data/lib/forgejo/models/commit_meta.rb +232 -0
- data/lib/forgejo/models/commit_stats.rb +233 -0
- data/lib/forgejo/models/commit_status.rb +288 -0
- data/lib/forgejo/models/commit_user.rb +232 -0
- data/lib/forgejo/models/compare.rb +225 -0
- data/lib/forgejo/models/contents_response.rb +346 -0
- data/lib/forgejo/models/create_access_token_option.rb +233 -0
- data/lib/forgejo/models/create_branch_protection_option.rb +446 -0
- data/lib/forgejo/models/create_branch_repo_option.rb +243 -0
- data/lib/forgejo/models/create_email_option.rb +218 -0
- data/lib/forgejo/models/create_file_options.rb +290 -0
- data/lib/forgejo/models/create_fork_option.rb +226 -0
- data/lib/forgejo/models/create_gpg_key_option.rb +232 -0
- data/lib/forgejo/models/create_hook_option.rb +315 -0
- data/lib/forgejo/models/create_issue_comment_option.rb +231 -0
- data/lib/forgejo/models/create_issue_option.rb +301 -0
- data/lib/forgejo/models/create_key_option.rb +250 -0
- data/lib/forgejo/models/create_label_option.rb +265 -0
- data/lib/forgejo/models/create_milestone_option.rb +276 -0
- data/lib/forgejo/models/create_o_auth2_application_options.rb +235 -0
- data/lib/forgejo/models/create_or_update_secret_option.rb +223 -0
- data/lib/forgejo/models/create_org_option.rb +320 -0
- data/lib/forgejo/models/create_pull_request_option.rb +291 -0
- data/lib/forgejo/models/create_pull_review_comment.rb +245 -0
- data/lib/forgejo/models/create_pull_review_options.rb +245 -0
- data/lib/forgejo/models/create_push_mirror_option.rb +250 -0
- data/lib/forgejo/models/create_release_option.rb +276 -0
- data/lib/forgejo/models/create_repo_option.rb +379 -0
- data/lib/forgejo/models/create_status_option.rb +243 -0
- data/lib/forgejo/models/create_tag_option.rb +240 -0
- data/lib/forgejo/models/create_tag_protection_option.rb +237 -0
- data/lib/forgejo/models/create_team_option.rb +314 -0
- data/lib/forgejo/models/create_user_option.rb +320 -0
- data/lib/forgejo/models/create_variable_option.rb +223 -0
- data/lib/forgejo/models/create_wiki_page_options.rb +236 -0
- data/lib/forgejo/models/cron.rb +251 -0
- data/lib/forgejo/models/delete_email_option.rb +218 -0
- data/lib/forgejo/models/delete_file_options.rb +290 -0
- data/lib/forgejo/models/delete_labels_option.rb +215 -0
- data/lib/forgejo/models/deploy_key.rb +287 -0
- data/lib/forgejo/models/dismiss_pull_review_options.rb +224 -0
- data/lib/forgejo/models/dispatch_workflow_option.rb +235 -0
- data/lib/forgejo/models/edit_attachment_options.rb +215 -0
- data/lib/forgejo/models/edit_branch_protection_option.rb +427 -0
- data/lib/forgejo/models/edit_deadline_option.rb +222 -0
- data/lib/forgejo/models/edit_git_hook_option.rb +215 -0
- data/lib/forgejo/models/edit_hook_option.rb +255 -0
- data/lib/forgejo/models/edit_issue_comment_option.rb +231 -0
- data/lib/forgejo/models/edit_issue_option.rb +299 -0
- data/lib/forgejo/models/edit_label_option.rb +251 -0
- data/lib/forgejo/models/edit_milestone_option.rb +242 -0
- data/lib/forgejo/models/edit_org_option.rb +304 -0
- data/lib/forgejo/models/edit_pull_request_option.rb +309 -0
- data/lib/forgejo/models/edit_reaction_option.rb +215 -0
- data/lib/forgejo/models/edit_release_option.rb +269 -0
- data/lib/forgejo/models/edit_repo_option.rb +533 -0
- data/lib/forgejo/models/edit_tag_protection_option.rb +237 -0
- data/lib/forgejo/models/edit_team_option.rb +314 -0
- data/lib/forgejo/models/edit_user_option.rb +377 -0
- data/lib/forgejo/models/email.rb +251 -0
- data/lib/forgejo/models/external_tracker.rb +246 -0
- data/lib/forgejo/models/external_wiki.rb +216 -0
- data/lib/forgejo/models/file_commit_response.rb +288 -0
- data/lib/forgejo/models/file_delete_response.rb +233 -0
- data/lib/forgejo/models/file_links_response.rb +233 -0
- data/lib/forgejo/models/file_response.rb +233 -0
- data/lib/forgejo/models/files_response.rb +235 -0
- data/lib/forgejo/models/general_api_settings.rb +242 -0
- data/lib/forgejo/models/general_attachment_settings.rb +242 -0
- data/lib/forgejo/models/general_repo_settings.rb +269 -0
- data/lib/forgejo/models/general_ui_settings.rb +237 -0
- data/lib/forgejo/models/generate_repo_option.rb +340 -0
- data/lib/forgejo/models/git_blob_response.rb +251 -0
- data/lib/forgejo/models/git_entry.rb +260 -0
- data/lib/forgejo/models/git_hook.rb +233 -0
- data/lib/forgejo/models/git_object.rb +232 -0
- data/lib/forgejo/models/git_tree_response.rb +262 -0
- data/lib/forgejo/models/gitignore_template_info.rb +224 -0
- data/lib/forgejo/models/gpg_key.rb +327 -0
- data/lib/forgejo/models/gpg_key_email.rb +224 -0
- data/lib/forgejo/models/hook.rb +319 -0
- data/lib/forgejo/models/identity.rb +224 -0
- data/lib/forgejo/models/internal_tracker.rb +236 -0
- data/lib/forgejo/models/issue.rb +438 -0
- data/lib/forgejo/models/issue_config.rb +225 -0
- data/lib/forgejo/models/issue_config_contact_link.rb +232 -0
- data/lib/forgejo/models/issue_config_validation.rb +223 -0
- data/lib/forgejo/models/issue_deadline.rb +215 -0
- data/lib/forgejo/models/issue_form_field.rb +257 -0
- data/lib/forgejo/models/issue_labels_option.rb +227 -0
- data/lib/forgejo/models/issue_meta.rb +233 -0
- data/lib/forgejo/models/issue_template.rb +282 -0
- data/lib/forgejo/models/label.rb +269 -0
- data/lib/forgejo/models/label_template.rb +242 -0
- data/lib/forgejo/models/license_template_info.rb +251 -0
- data/lib/forgejo/models/licenses_template_list_entry.rb +233 -0
- data/lib/forgejo/models/markdown_option.rb +246 -0
- data/lib/forgejo/models/markup_option.rb +256 -0
- data/lib/forgejo/models/merge_pull_request_option.rb +319 -0
- data/lib/forgejo/models/migrate_repo_options.rb +436 -0
- data/lib/forgejo/models/milestone.rb +297 -0
- data/lib/forgejo/models/new_issue_pins_allowed.rb +224 -0
- data/lib/forgejo/models/node_info.rb +271 -0
- data/lib/forgejo/models/node_info_services.rb +228 -0
- data/lib/forgejo/models/node_info_software.rb +242 -0
- data/lib/forgejo/models/node_info_usage.rb +233 -0
- data/lib/forgejo/models/node_info_usage_users.rb +233 -0
- data/lib/forgejo/models/note.rb +224 -0
- data/lib/forgejo/models/notification_count.rb +215 -0
- data/lib/forgejo/models/notification_subject.rb +271 -0
- data/lib/forgejo/models/notification_thread.rb +269 -0
- data/lib/forgejo/models/o_auth2_application.rb +270 -0
- data/lib/forgejo/models/organization.rb +306 -0
- data/lib/forgejo/models/organization_permissions.rb +251 -0
- data/lib/forgejo/models/package.rb +287 -0
- data/lib/forgejo/models/package_file.rb +269 -0
- data/lib/forgejo/models/payload_commit.rb +303 -0
- data/lib/forgejo/models/payload_commit_verification.rb +251 -0
- data/lib/forgejo/models/payload_user.rb +234 -0
- data/lib/forgejo/models/permission.rb +233 -0
- data/lib/forgejo/models/pr_branch_info.rb +251 -0
- data/lib/forgejo/models/public_key.rb +287 -0
- data/lib/forgejo/models/pull_request.rb +538 -0
- data/lib/forgejo/models/pull_request_meta.rb +242 -0
- data/lib/forgejo/models/pull_review.rb +333 -0
- data/lib/forgejo/models/pull_review_comment.rb +341 -0
- data/lib/forgejo/models/pull_review_request_options.rb +228 -0
- data/lib/forgejo/models/push_mirror.rb +278 -0
- data/lib/forgejo/models/reaction.rb +233 -0
- data/lib/forgejo/models/reference.rb +232 -0
- data/lib/forgejo/models/release.rb +370 -0
- data/lib/forgejo/models/rename_user_option.rb +223 -0
- data/lib/forgejo/models/replace_flags_option.rb +217 -0
- data/lib/forgejo/models/repo_collaborator_permission.rb +233 -0
- data/lib/forgejo/models/repo_commit.rb +259 -0
- data/lib/forgejo/models/repo_create_release_attachment_request.rb +215 -0
- data/lib/forgejo/models/repo_topic_options.rb +218 -0
- data/lib/forgejo/models/repo_transfer.rb +235 -0
- data/lib/forgejo/models/repository.rb +801 -0
- data/lib/forgejo/models/repository_meta.rb +242 -0
- data/lib/forgejo/models/search_results.rb +226 -0
- data/lib/forgejo/models/secret.rb +225 -0
- data/lib/forgejo/models/server_version.rb +215 -0
- data/lib/forgejo/models/stop_watch.rb +269 -0
- data/lib/forgejo/models/submit_pull_review_options.rb +225 -0
- data/lib/forgejo/models/tag.rb +269 -0
- data/lib/forgejo/models/tag_archive_download_count.rb +224 -0
- data/lib/forgejo/models/tag_protection.rb +264 -0
- data/lib/forgejo/models/team.rb +325 -0
- data/lib/forgejo/models/team_search200_response.rb +225 -0
- data/lib/forgejo/models/timeline_comment.rb +469 -0
- data/lib/forgejo/models/topic_name.rb +217 -0
- data/lib/forgejo/models/topic_response.rb +251 -0
- data/lib/forgejo/models/tracked_time.rb +272 -0
- data/lib/forgejo/models/transfer_repo_option.rb +234 -0
- data/lib/forgejo/models/update_file_options.rb +317 -0
- data/lib/forgejo/models/update_repo_avatar_option.rb +216 -0
- data/lib/forgejo/models/update_user_avatar_option.rb +216 -0
- data/lib/forgejo/models/update_variable_option.rb +233 -0
- data/lib/forgejo/models/user.rb +433 -0
- data/lib/forgejo/models/user_heatmap_data.rb +225 -0
- data/lib/forgejo/models/user_search200_response.rb +225 -0
- data/lib/forgejo/models/user_settings.rb +306 -0
- data/lib/forgejo/models/user_settings_options.rb +306 -0
- data/lib/forgejo/models/watch_info.rb +260 -0
- data/lib/forgejo/models/wiki_commit.rb +242 -0
- data/lib/forgejo/models/wiki_commit_list.rb +226 -0
- data/lib/forgejo/models/wiki_page.rb +279 -0
- data/lib/forgejo/models/wiki_page_meta_data.rb +242 -0
- data/lib/forgejo/version.rb +15 -0
- data/lib/forgejo.rb +241 -0
- data/manifest.scm +2 -0
- data/patch +7 -0
- data/patch~ +1 -0
- data/smoke +16 -0
- data/smoke~ +1 -0
- data/spec/api/activitypub_api_spec.rb +80 -0
- data/spec/api/admin_api_spec.rb +308 -0
- data/spec/api/issue_api_spec.rb +998 -0
- data/spec/api/miscellaneous_api_spec.rb +161 -0
- data/spec/api/notification_api_spec.rb +134 -0
- data/spec/api/organization_api_spec.rb +752 -0
- data/spec/api/package_api_spec.rb +92 -0
- data/spec/api/repository_api_spec.rb +2366 -0
- data/spec/api/settings_api_spec.rb +75 -0
- data/spec/api/user_api_spec.rb +839 -0
- data/spec/models/access_token_spec.rb +60 -0
- data/spec/models/action_task_response_spec.rb +42 -0
- data/spec/models/action_task_spec.rb +108 -0
- data/spec/models/action_variable_spec.rb +54 -0
- data/spec/models/activity_pub_spec.rb +36 -0
- data/spec/models/activity_spec.rb +112 -0
- data/spec/models/add_collaborator_option_spec.rb +36 -0
- data/spec/models/add_time_option_spec.rb +48 -0
- data/spec/models/annotated_tag_object_spec.rb +48 -0
- data/spec/models/annotated_tag_spec.rb +78 -0
- data/spec/models/api_error_spec.rb +42 -0
- data/spec/models/attachment_spec.rb +72 -0
- data/spec/models/blocked_user_spec.rb +42 -0
- data/spec/models/branch_protection_spec.rb +192 -0
- data/spec/models/branch_spec.rb +84 -0
- data/spec/models/change_file_operation_spec.rb +64 -0
- data/spec/models/change_files_options_spec.rb +78 -0
- data/spec/models/changed_file_spec.rb +84 -0
- data/spec/models/combined_status_spec.rb +72 -0
- data/spec/models/comment_spec.rb +96 -0
- data/spec/models/commit_affected_files_spec.rb +42 -0
- data/spec/models/commit_date_options_spec.rb +42 -0
- data/spec/models/commit_meta_spec.rb +48 -0
- data/spec/models/commit_spec.rb +90 -0
- data/spec/models/commit_stats_spec.rb +48 -0
- data/spec/models/commit_status_spec.rb +84 -0
- data/spec/models/commit_user_spec.rb +48 -0
- data/spec/models/compare_spec.rb +42 -0
- data/spec/models/contents_response_spec.rb +120 -0
- data/spec/models/create_access_token_option_spec.rb +42 -0
- data/spec/models/create_branch_protection_option_spec.rb +180 -0
- data/spec/models/create_branch_repo_option_spec.rb +48 -0
- data/spec/models/create_email_option_spec.rb +36 -0
- data/spec/models/create_file_options_spec.rb +78 -0
- data/spec/models/create_fork_option_spec.rb +42 -0
- data/spec/models/create_gpg_key_option_spec.rb +42 -0
- data/spec/models/create_hook_option_spec.rb +70 -0
- data/spec/models/create_issue_comment_option_spec.rb +42 -0
- data/spec/models/create_issue_option_spec.rb +84 -0
- data/spec/models/create_key_option_spec.rb +48 -0
- data/spec/models/create_label_option_spec.rb +60 -0
- data/spec/models/create_milestone_option_spec.rb +58 -0
- data/spec/models/create_o_auth2_application_options_spec.rb +48 -0
- data/spec/models/create_or_update_secret_option_spec.rb +36 -0
- data/spec/models/create_org_option_spec.rb +82 -0
- data/spec/models/create_pull_request_option_spec.rb +84 -0
- data/spec/models/create_pull_review_comment_spec.rb +54 -0
- data/spec/models/create_pull_review_options_spec.rb +54 -0
- data/spec/models/create_push_mirror_option_spec.rb +60 -0
- data/spec/models/create_release_option_spec.rb +72 -0
- data/spec/models/create_repo_option_spec.rb +110 -0
- data/spec/models/create_status_option_spec.rb +54 -0
- data/spec/models/create_tag_option_spec.rb +48 -0
- data/spec/models/create_tag_protection_option_spec.rb +48 -0
- data/spec/models/create_team_option_spec.rb +76 -0
- data/spec/models/create_user_option_spec.rb +96 -0
- data/spec/models/create_variable_option_spec.rb +36 -0
- data/spec/models/create_wiki_page_options_spec.rb +48 -0
- data/spec/models/cron_spec.rb +60 -0
- data/spec/models/delete_email_option_spec.rb +36 -0
- data/spec/models/delete_file_options_spec.rb +78 -0
- data/spec/models/delete_labels_option_spec.rb +36 -0
- data/spec/models/deploy_key_spec.rb +84 -0
- data/spec/models/dismiss_pull_review_options_spec.rb +42 -0
- data/spec/models/dispatch_workflow_option_spec.rb +42 -0
- data/spec/models/edit_attachment_options_spec.rb +36 -0
- data/spec/models/edit_branch_protection_option_spec.rb +168 -0
- data/spec/models/edit_deadline_option_spec.rb +36 -0
- data/spec/models/edit_git_hook_option_spec.rb +36 -0
- data/spec/models/edit_hook_option_spec.rb +60 -0
- data/spec/models/edit_issue_comment_option_spec.rb +42 -0
- data/spec/models/edit_issue_option_spec.rb +90 -0
- data/spec/models/edit_label_option_spec.rb +60 -0
- data/spec/models/edit_milestone_option_spec.rb +54 -0
- data/spec/models/edit_org_option_spec.rb +76 -0
- data/spec/models/edit_pull_request_option_spec.rb +96 -0
- data/spec/models/edit_reaction_option_spec.rb +36 -0
- data/spec/models/edit_release_option_spec.rb +72 -0
- data/spec/models/edit_repo_option_spec.rb +228 -0
- data/spec/models/edit_tag_protection_option_spec.rb +48 -0
- data/spec/models/edit_team_option_spec.rb +76 -0
- data/spec/models/edit_user_option_spec.rb +144 -0
- data/spec/models/email_spec.rb +60 -0
- data/spec/models/external_tracker_spec.rb +54 -0
- data/spec/models/external_wiki_spec.rb +36 -0
- data/spec/models/file_commit_response_spec.rb +84 -0
- data/spec/models/file_delete_response_spec.rb +48 -0
- data/spec/models/file_links_response_spec.rb +48 -0
- data/spec/models/file_response_spec.rb +48 -0
- data/spec/models/files_response_spec.rb +48 -0
- data/spec/models/general_api_settings_spec.rb +54 -0
- data/spec/models/general_attachment_settings_spec.rb +54 -0
- data/spec/models/general_repo_settings_spec.rb +72 -0
- data/spec/models/general_ui_settings_spec.rb +48 -0
- data/spec/models/generate_repo_option_spec.rb +102 -0
- data/spec/models/git_blob_response_spec.rb +60 -0
- data/spec/models/git_entry_spec.rb +66 -0
- data/spec/models/git_hook_spec.rb +48 -0
- data/spec/models/git_object_spec.rb +48 -0
- data/spec/models/git_tree_response_spec.rb +66 -0
- data/spec/models/gitignore_template_info_spec.rb +42 -0
- data/spec/models/gpg_key_email_spec.rb +42 -0
- data/spec/models/gpg_key_spec.rb +108 -0
- data/spec/models/hook_spec.rb +102 -0
- data/spec/models/identity_spec.rb +42 -0
- data/spec/models/internal_tracker_spec.rb +48 -0
- data/spec/models/issue_config_contact_link_spec.rb +48 -0
- data/spec/models/issue_config_spec.rb +42 -0
- data/spec/models/issue_config_validation_spec.rb +42 -0
- data/spec/models/issue_deadline_spec.rb +36 -0
- data/spec/models/issue_form_field_spec.rb +60 -0
- data/spec/models/issue_labels_option_spec.rb +42 -0
- data/spec/models/issue_meta_spec.rb +48 -0
- data/spec/models/issue_spec.rb +180 -0
- data/spec/models/issue_template_spec.rb +78 -0
- data/spec/models/label_spec.rb +72 -0
- data/spec/models/label_template_spec.rb +54 -0
- data/spec/models/license_template_info_spec.rb +60 -0
- data/spec/models/licenses_template_list_entry_spec.rb +48 -0
- data/spec/models/markdown_option_spec.rb +54 -0
- data/spec/models/markup_option_spec.rb +60 -0
- data/spec/models/merge_pull_request_option_spec.rb +82 -0
- data/spec/models/migrate_repo_options_spec.rb +154 -0
- data/spec/models/milestone_spec.rb +90 -0
- data/spec/models/new_issue_pins_allowed_spec.rb +42 -0
- data/spec/models/node_info_services_spec.rb +42 -0
- data/spec/models/node_info_software_spec.rb +54 -0
- data/spec/models/node_info_spec.rb +72 -0
- data/spec/models/node_info_usage_spec.rb +48 -0
- data/spec/models/node_info_usage_users_spec.rb +48 -0
- data/spec/models/note_spec.rb +42 -0
- data/spec/models/notification_count_spec.rb +36 -0
- data/spec/models/notification_subject_spec.rb +72 -0
- data/spec/models/notification_thread_spec.rb +72 -0
- data/spec/models/o_auth2_application_spec.rb +72 -0
- data/spec/models/organization_permissions_spec.rb +60 -0
- data/spec/models/organization_spec.rb +96 -0
- data/spec/models/package_file_spec.rb +72 -0
- data/spec/models/package_spec.rb +84 -0
- data/spec/models/payload_commit_spec.rb +90 -0
- data/spec/models/payload_commit_verification_spec.rb +60 -0
- data/spec/models/payload_user_spec.rb +48 -0
- data/spec/models/permission_spec.rb +48 -0
- data/spec/models/pr_branch_info_spec.rb +60 -0
- data/spec/models/public_key_spec.rb +84 -0
- data/spec/models/pull_request_meta_spec.rb +54 -0
- data/spec/models/pull_request_spec.rb +246 -0
- data/spec/models/pull_review_comment_spec.rb +120 -0
- data/spec/models/pull_review_request_options_spec.rb +42 -0
- data/spec/models/pull_review_spec.rb +114 -0
- data/spec/models/push_mirror_spec.rb +78 -0
- data/spec/models/reaction_spec.rb +48 -0
- data/spec/models/reference_spec.rb +48 -0
- data/spec/models/release_spec.rb +138 -0
- data/spec/models/rename_user_option_spec.rb +36 -0
- data/spec/models/replace_flags_option_spec.rb +36 -0
- data/spec/models/repo_collaborator_permission_spec.rb +48 -0
- data/spec/models/repo_commit_spec.rb +66 -0
- data/spec/models/repo_create_release_attachment_request_spec.rb +36 -0
- data/spec/models/repo_topic_options_spec.rb +36 -0
- data/spec/models/repo_transfer_spec.rb +48 -0
- data/spec/models/repository_meta_spec.rb +54 -0
- data/spec/models/repository_spec.rb +406 -0
- data/spec/models/search_results_spec.rb +42 -0
- data/spec/models/secret_spec.rb +42 -0
- data/spec/models/server_version_spec.rb +36 -0
- data/spec/models/stop_watch_spec.rb +72 -0
- data/spec/models/submit_pull_review_options_spec.rb +42 -0
- data/spec/models/tag_archive_download_count_spec.rb +42 -0
- data/spec/models/tag_protection_spec.rb +66 -0
- data/spec/models/tag_spec.rb +72 -0
- data/spec/models/team_search200_response_spec.rb +42 -0
- data/spec/models/team_spec.rb +88 -0
- data/spec/models/timeline_comment_spec.rb +204 -0
- data/spec/models/topic_name_spec.rb +36 -0
- data/spec/models/topic_response_spec.rb +60 -0
- data/spec/models/tracked_time_spec.rb +72 -0
- data/spec/models/transfer_repo_option_spec.rb +42 -0
- data/spec/models/update_file_options_spec.rb +90 -0
- data/spec/models/update_repo_avatar_option_spec.rb +36 -0
- data/spec/models/update_user_avatar_option_spec.rb +36 -0
- data/spec/models/update_variable_option_spec.rb +42 -0
- data/spec/models/user_heatmap_data_spec.rb +42 -0
- data/spec/models/user_search200_response_spec.rb +42 -0
- data/spec/models/user_settings_options_spec.rb +96 -0
- data/spec/models/user_settings_spec.rb +96 -0
- data/spec/models/user_spec.rb +168 -0
- data/spec/models/watch_info_spec.rb +66 -0
- data/spec/models/wiki_commit_list_spec.rb +42 -0
- data/spec/models/wiki_commit_spec.rb +54 -0
- data/spec/models/wiki_page_meta_data_spec.rb +54 -0
- data/spec/models/wiki_page_spec.rb +78 -0
- data/spec/spec_helper.rb +111 -0
- data/swagger.v1.json +26802 -0
- data/swagger.v1.patched.json +1 -0
- metadata +949 -0
@@ -0,0 +1,392 @@
|
|
1
|
+
=begin
|
2
|
+
#Forgejo API
|
3
|
+
|
4
|
+
#This documentation describes the Forgejo API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 8.0.3-53-9d5cce4bcc+gitea-1.22.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.9.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module Forgejo
|
14
|
+
class Configuration
|
15
|
+
# Defines url scheme
|
16
|
+
attr_accessor :scheme
|
17
|
+
|
18
|
+
# Defines url host
|
19
|
+
attr_accessor :host
|
20
|
+
|
21
|
+
# Defines url base path
|
22
|
+
attr_accessor :base_path
|
23
|
+
|
24
|
+
# Define server configuration index
|
25
|
+
attr_accessor :server_index
|
26
|
+
|
27
|
+
# Define server operation configuration index
|
28
|
+
attr_accessor :server_operation_index
|
29
|
+
|
30
|
+
# Default server variables
|
31
|
+
attr_accessor :server_variables
|
32
|
+
|
33
|
+
# Default server operation variables
|
34
|
+
attr_accessor :server_operation_variables
|
35
|
+
|
36
|
+
# Defines API keys used with API Key authentications.
|
37
|
+
#
|
38
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
39
|
+
#
|
40
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
41
|
+
# config.api_key['api_key'] = 'xxx'
|
42
|
+
attr_accessor :api_key
|
43
|
+
|
44
|
+
# Defines API key prefixes used with API Key authentications.
|
45
|
+
#
|
46
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
47
|
+
#
|
48
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
49
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
50
|
+
attr_accessor :api_key_prefix
|
51
|
+
|
52
|
+
# Defines the username used with HTTP basic authentication.
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
attr_accessor :username
|
56
|
+
|
57
|
+
# Defines the password used with HTTP basic authentication.
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
attr_accessor :password
|
61
|
+
|
62
|
+
# Defines the access token (Bearer) used with OAuth2.
|
63
|
+
attr_accessor :access_token
|
64
|
+
|
65
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
66
|
+
# Overrides the access_token if set
|
67
|
+
# @return [Proc]
|
68
|
+
attr_accessor :access_token_getter
|
69
|
+
|
70
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
71
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
72
|
+
# Default to false.
|
73
|
+
attr_accessor :return_binary_data
|
74
|
+
|
75
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
76
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
77
|
+
# Default to false.
|
78
|
+
#
|
79
|
+
# @return [true, false]
|
80
|
+
attr_accessor :debugging
|
81
|
+
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
86
|
+
# Default to false.
|
87
|
+
# @return [true, false]
|
88
|
+
attr_accessor :ignore_operation_servers
|
89
|
+
|
90
|
+
# Defines the logger used for debugging.
|
91
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
92
|
+
#
|
93
|
+
# @return [#debug]
|
94
|
+
attr_accessor :logger
|
95
|
+
|
96
|
+
# Defines the temporary folder to store downloaded files
|
97
|
+
# (for API endpoints that have file response).
|
98
|
+
# Default to use `Tempfile`.
|
99
|
+
#
|
100
|
+
# @return [String]
|
101
|
+
attr_accessor :temp_folder_path
|
102
|
+
|
103
|
+
# The time limit for HTTP request in seconds.
|
104
|
+
# Default to 0 (never times out).
|
105
|
+
attr_accessor :timeout
|
106
|
+
|
107
|
+
# Set this to false to skip client side validation in the operation.
|
108
|
+
# Default to true.
|
109
|
+
# @return [true, false]
|
110
|
+
attr_accessor :client_side_validation
|
111
|
+
|
112
|
+
### TLS/SSL setting
|
113
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
114
|
+
# Default to true.
|
115
|
+
#
|
116
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
117
|
+
#
|
118
|
+
# @return [true, false]
|
119
|
+
attr_accessor :ssl_verify
|
120
|
+
|
121
|
+
### TLS/SSL setting
|
122
|
+
# Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
|
123
|
+
#
|
124
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
125
|
+
#
|
126
|
+
attr_accessor :ssl_verify_mode
|
127
|
+
|
128
|
+
### TLS/SSL setting
|
129
|
+
# Set this to customize the certificate file to verify the peer.
|
130
|
+
#
|
131
|
+
# @return [String] the path to the certificate file
|
132
|
+
attr_accessor :ssl_ca_file
|
133
|
+
|
134
|
+
### TLS/SSL setting
|
135
|
+
# Client certificate file (for client certificate)
|
136
|
+
attr_accessor :ssl_client_cert
|
137
|
+
|
138
|
+
### TLS/SSL setting
|
139
|
+
# Client private key file (for client certificate)
|
140
|
+
attr_accessor :ssl_client_key
|
141
|
+
|
142
|
+
### Proxy setting
|
143
|
+
# HTTP Proxy settings
|
144
|
+
attr_accessor :proxy
|
145
|
+
|
146
|
+
# Set this to customize parameters encoder of array parameter.
|
147
|
+
# Default to nil. Faraday uses NestedParamsEncoder when nil.
|
148
|
+
#
|
149
|
+
# @see The params_encoder option of Faraday. Related source code:
|
150
|
+
# https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders
|
151
|
+
attr_accessor :params_encoder
|
152
|
+
|
153
|
+
|
154
|
+
attr_accessor :inject_format
|
155
|
+
|
156
|
+
attr_accessor :force_ending_format
|
157
|
+
|
158
|
+
def initialize
|
159
|
+
@scheme = 'http'
|
160
|
+
@host = 'localhost'
|
161
|
+
@base_path = '/api/v1'
|
162
|
+
@server_index = nil
|
163
|
+
@server_operation_index = {}
|
164
|
+
@server_variables = {}
|
165
|
+
@server_operation_variables = {}
|
166
|
+
@api_key = {}
|
167
|
+
@api_key_prefix = {}
|
168
|
+
@client_side_validation = true
|
169
|
+
@ssl_verify = true
|
170
|
+
@ssl_verify_mode = nil
|
171
|
+
@ssl_ca_file = nil
|
172
|
+
@ssl_client_cert = nil
|
173
|
+
@ssl_client_key = nil
|
174
|
+
@middlewares = Hash.new { |h, k| h[k] = [] }
|
175
|
+
@configure_connection_blocks = []
|
176
|
+
@timeout = 60
|
177
|
+
# return data as binary instead of file
|
178
|
+
@return_binary_data = false
|
179
|
+
@params_encoder = nil
|
180
|
+
@debugging = false
|
181
|
+
@ignore_operation_servers = false
|
182
|
+
@inject_format = false
|
183
|
+
@force_ending_format = false
|
184
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
185
|
+
|
186
|
+
yield(self) if block_given?
|
187
|
+
end
|
188
|
+
|
189
|
+
# The default Configuration object.
|
190
|
+
def self.default
|
191
|
+
@@default ||= Configuration.new
|
192
|
+
end
|
193
|
+
|
194
|
+
def configure
|
195
|
+
yield(self) if block_given?
|
196
|
+
end
|
197
|
+
|
198
|
+
def scheme=(scheme)
|
199
|
+
# remove :// from scheme
|
200
|
+
@scheme = scheme.sub(/:\/\//, '')
|
201
|
+
end
|
202
|
+
|
203
|
+
def host=(host)
|
204
|
+
# remove http(s):// and anything after a slash
|
205
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
206
|
+
end
|
207
|
+
|
208
|
+
def base_path=(base_path)
|
209
|
+
# Add leading and trailing slashes to base_path
|
210
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
211
|
+
@base_path = '' if @base_path == '/'
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns base URL for specified operation based on server settings
|
215
|
+
def base_url(operation = nil)
|
216
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
217
|
+
if operation_server_settings.key?(operation) then
|
218
|
+
index = server_operation_index.fetch(operation, server_index)
|
219
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
220
|
+
else
|
221
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Gets API key (with prefix if set).
|
226
|
+
# @param [String] param_name the parameter name of API key auth
|
227
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
228
|
+
key = @api_key[param_name]
|
229
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
230
|
+
if @api_key_prefix[param_name]
|
231
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
232
|
+
else
|
233
|
+
key
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
238
|
+
def access_token_with_refresh
|
239
|
+
return access_token if access_token_getter.nil?
|
240
|
+
access_token_getter.call
|
241
|
+
end
|
242
|
+
|
243
|
+
# Gets Basic Auth token string
|
244
|
+
def basic_auth_token
|
245
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
246
|
+
end
|
247
|
+
|
248
|
+
# Returns Auth Settings hash for api client.
|
249
|
+
def auth_settings
|
250
|
+
{
|
251
|
+
'AuthorizationHeaderToken' =>
|
252
|
+
{
|
253
|
+
type: 'api_key',
|
254
|
+
in: 'header',
|
255
|
+
key: 'Authorization',
|
256
|
+
value: api_key_with_prefix('Authorization')
|
257
|
+
},
|
258
|
+
}
|
259
|
+
end
|
260
|
+
|
261
|
+
# Returns an array of Server setting
|
262
|
+
def server_settings
|
263
|
+
[
|
264
|
+
{
|
265
|
+
url: "/api/v1",
|
266
|
+
description: "No description provided",
|
267
|
+
}
|
268
|
+
]
|
269
|
+
end
|
270
|
+
|
271
|
+
def operation_server_settings
|
272
|
+
{
|
273
|
+
}
|
274
|
+
end
|
275
|
+
|
276
|
+
# Returns URL based on server settings
|
277
|
+
#
|
278
|
+
# @param index array index of the server settings
|
279
|
+
# @param variables hash of variable and the corresponding value
|
280
|
+
def server_url(index, variables = {}, servers = nil)
|
281
|
+
servers = server_settings if servers == nil
|
282
|
+
|
283
|
+
# check array index out of bound
|
284
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
285
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
286
|
+
end
|
287
|
+
|
288
|
+
server = servers[index]
|
289
|
+
url = server[:url]
|
290
|
+
|
291
|
+
return url unless server.key? :variables
|
292
|
+
|
293
|
+
# go through variable and assign a value
|
294
|
+
server[:variables].each do |name, variable|
|
295
|
+
if variables.key?(name)
|
296
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
297
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
298
|
+
else
|
299
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
300
|
+
end
|
301
|
+
else
|
302
|
+
# use default value
|
303
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
url
|
308
|
+
end
|
309
|
+
|
310
|
+
# Configure Faraday connection directly.
|
311
|
+
#
|
312
|
+
# ```
|
313
|
+
# c.configure_faraday_connection do |conn|
|
314
|
+
# conn.use Faraday::HttpCache, shared_cache: false, logger: logger
|
315
|
+
# conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger|
|
316
|
+
# logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]')
|
317
|
+
# end
|
318
|
+
# end
|
319
|
+
#
|
320
|
+
# c.configure_faraday_connection do |conn|
|
321
|
+
# conn.adapter :typhoeus
|
322
|
+
# end
|
323
|
+
# ```
|
324
|
+
#
|
325
|
+
# @param block [Proc] `#call`able object that takes one arg, the connection
|
326
|
+
def configure_faraday_connection(&block)
|
327
|
+
@configure_connection_blocks << block
|
328
|
+
end
|
329
|
+
|
330
|
+
def configure_connection(conn)
|
331
|
+
@configure_connection_blocks.each do |block|
|
332
|
+
block.call(conn)
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
# Adds middleware to the stack
|
337
|
+
def use(*middleware)
|
338
|
+
set_faraday_middleware(:use, *middleware)
|
339
|
+
end
|
340
|
+
|
341
|
+
# Adds request middleware to the stack
|
342
|
+
def request(*middleware)
|
343
|
+
set_faraday_middleware(:request, *middleware)
|
344
|
+
end
|
345
|
+
|
346
|
+
# Adds response middleware to the stack
|
347
|
+
def response(*middleware)
|
348
|
+
set_faraday_middleware(:response, *middleware)
|
349
|
+
end
|
350
|
+
|
351
|
+
# Adds Faraday middleware setting information to the stack
|
352
|
+
#
|
353
|
+
# @example Use the `set_faraday_middleware` method to set middleware information
|
354
|
+
# config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503])
|
355
|
+
# config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug })
|
356
|
+
# config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false)
|
357
|
+
# config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 })
|
358
|
+
# config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger)
|
359
|
+
# config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware)
|
360
|
+
#
|
361
|
+
# @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143
|
362
|
+
def set_faraday_middleware(operation, key, *args, &block)
|
363
|
+
unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation)
|
364
|
+
fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \
|
365
|
+
" :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete."
|
366
|
+
end
|
367
|
+
|
368
|
+
@middlewares[operation] << [key, args, block]
|
369
|
+
end
|
370
|
+
ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true)
|
371
|
+
|
372
|
+
# Set up middleware on the connection
|
373
|
+
def configure_middleware(connection)
|
374
|
+
return if @middlewares.empty?
|
375
|
+
|
376
|
+
[:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation|
|
377
|
+
next unless @middlewares.key?(operation)
|
378
|
+
|
379
|
+
@middlewares[operation].each do |key, args, block|
|
380
|
+
connection.builder.send(operation, key, *args, &block)
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
if @middlewares.key?(:delete)
|
385
|
+
@middlewares[:delete].each do |key, _args, _block|
|
386
|
+
connection.builder.delete(key)
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
end
|
392
|
+
end
|
@@ -0,0 +1,252 @@
|
|
1
|
+
=begin
|
2
|
+
#Forgejo API
|
3
|
+
|
4
|
+
#This documentation describes the Forgejo API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 8.0.3-53-9d5cce4bcc+gitea-1.22.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.9.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Forgejo
|
17
|
+
class AccessToken
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :name
|
21
|
+
|
22
|
+
attr_accessor :scopes
|
23
|
+
|
24
|
+
attr_accessor :sha1
|
25
|
+
|
26
|
+
attr_accessor :token_last_eight
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'id' => :'id',
|
32
|
+
:'name' => :'name',
|
33
|
+
:'scopes' => :'scopes',
|
34
|
+
:'sha1' => :'sha1',
|
35
|
+
:'token_last_eight' => :'token_last_eight'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns all the JSON keys this model knows about
|
40
|
+
def self.acceptable_attributes
|
41
|
+
attribute_map.values
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'id' => :'Integer',
|
48
|
+
:'name' => :'String',
|
49
|
+
:'scopes' => :'Array<String>',
|
50
|
+
:'sha1' => :'String',
|
51
|
+
:'token_last_eight' => :'String'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# List of attributes with nullable: true
|
56
|
+
def self.openapi_nullable
|
57
|
+
Set.new([
|
58
|
+
])
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
if (!attributes.is_a?(Hash))
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Forgejo::AccessToken` initialize method"
|
66
|
+
end
|
67
|
+
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::AccessToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
72
|
+
end
|
73
|
+
h[k.to_sym] = v
|
74
|
+
}
|
75
|
+
|
76
|
+
if attributes.key?(:'id')
|
77
|
+
self.id = attributes[:'id']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'name')
|
81
|
+
self.name = attributes[:'name']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'scopes')
|
85
|
+
if (value = attributes[:'scopes']).is_a?(Array)
|
86
|
+
self.scopes = value
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'sha1')
|
91
|
+
self.sha1 = attributes[:'sha1']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'token_last_eight')
|
95
|
+
self.token_last_eight = attributes[:'token_last_eight']
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
100
|
+
# @return Array for valid properties with the reasons
|
101
|
+
def list_invalid_properties
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
103
|
+
invalid_properties = Array.new
|
104
|
+
invalid_properties
|
105
|
+
end
|
106
|
+
|
107
|
+
# Check to see if the all the properties in the model are valid
|
108
|
+
# @return true if the model is valid
|
109
|
+
def valid?
|
110
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
111
|
+
true
|
112
|
+
end
|
113
|
+
|
114
|
+
# Checks equality by comparing each attribute.
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def ==(o)
|
117
|
+
return true if self.equal?(o)
|
118
|
+
self.class == o.class &&
|
119
|
+
id == o.id &&
|
120
|
+
name == o.name &&
|
121
|
+
scopes == o.scopes &&
|
122
|
+
sha1 == o.sha1 &&
|
123
|
+
token_last_eight == o.token_last_eight
|
124
|
+
end
|
125
|
+
|
126
|
+
# @see the `==` method
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def eql?(o)
|
129
|
+
self == o
|
130
|
+
end
|
131
|
+
|
132
|
+
# Calculates hash code according to all attributes.
|
133
|
+
# @return [Integer] Hash code
|
134
|
+
def hash
|
135
|
+
[id, name, scopes, sha1, token_last_eight].hash
|
136
|
+
end
|
137
|
+
|
138
|
+
# Builds the object from hash
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
+
# @return [Object] Returns the model itself
|
141
|
+
def self.build_from_hash(attributes)
|
142
|
+
return nil unless attributes.is_a?(Hash)
|
143
|
+
attributes = attributes.transform_keys(&:to_sym)
|
144
|
+
transformed_hash = {}
|
145
|
+
openapi_types.each_pair do |key, type|
|
146
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
147
|
+
transformed_hash["#{key}"] = nil
|
148
|
+
elsif type =~ /\AArray<(.*)>/i
|
149
|
+
# check to ensure the input is an array given that the attribute
|
150
|
+
# is documented as an array but the input is not
|
151
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
152
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
153
|
+
end
|
154
|
+
elsif !attributes[attribute_map[key]].nil?
|
155
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
156
|
+
end
|
157
|
+
end
|
158
|
+
new(transformed_hash)
|
159
|
+
end
|
160
|
+
|
161
|
+
# Deserializes the data based on type
|
162
|
+
# @param string type Data type
|
163
|
+
# @param string value Value to be deserialized
|
164
|
+
# @return [Object] Deserialized data
|
165
|
+
def self._deserialize(type, value)
|
166
|
+
case type.to_sym
|
167
|
+
when :Time
|
168
|
+
Time.parse(value)
|
169
|
+
when :Date
|
170
|
+
Date.parse(value)
|
171
|
+
when :String
|
172
|
+
value.to_s
|
173
|
+
when :Integer
|
174
|
+
value.to_i
|
175
|
+
when :Float
|
176
|
+
value.to_f
|
177
|
+
when :Boolean
|
178
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
179
|
+
true
|
180
|
+
else
|
181
|
+
false
|
182
|
+
end
|
183
|
+
when :Object
|
184
|
+
# generic object (usually a Hash), return directly
|
185
|
+
value
|
186
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
187
|
+
inner_type = Regexp.last_match[:inner_type]
|
188
|
+
value.map { |v| _deserialize(inner_type, v) }
|
189
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
190
|
+
k_type = Regexp.last_match[:k_type]
|
191
|
+
v_type = Regexp.last_match[:v_type]
|
192
|
+
{}.tap do |hash|
|
193
|
+
value.each do |k, v|
|
194
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
else # model
|
198
|
+
# models (e.g. Pet) or oneOf
|
199
|
+
klass = Forgejo.const_get(type)
|
200
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the string representation of the object
|
205
|
+
# @return [String] String presentation of the object
|
206
|
+
def to_s
|
207
|
+
to_hash.to_s
|
208
|
+
end
|
209
|
+
|
210
|
+
# to_body is an alias to to_hash (backward compatibility)
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_body
|
213
|
+
to_hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns the object in the form of hash
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_hash
|
219
|
+
hash = {}
|
220
|
+
self.class.attribute_map.each_pair do |attr, param|
|
221
|
+
value = self.send(attr)
|
222
|
+
if value.nil?
|
223
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
224
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
225
|
+
end
|
226
|
+
|
227
|
+
hash[param] = _to_hash(value)
|
228
|
+
end
|
229
|
+
hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Outputs non-array value in the form of hash
|
233
|
+
# For object, use to_hash. Otherwise, just return the value
|
234
|
+
# @param [Object] value Any valid value
|
235
|
+
# @return [Hash] Returns the value in the form of hash
|
236
|
+
def _to_hash(value)
|
237
|
+
if value.is_a?(Array)
|
238
|
+
value.compact.map { |v| _to_hash(v) }
|
239
|
+
elsif value.is_a?(Hash)
|
240
|
+
{}.tap do |hash|
|
241
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
242
|
+
end
|
243
|
+
elsif value.respond_to? :to_hash
|
244
|
+
value.to_hash
|
245
|
+
else
|
246
|
+
value
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|