commit 0cc4bef6164d027bf3b803c311328690d86a4daf Author: NGnius Date: Wed May 13 19:42:15 2020 -0400 Minor update diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION new file mode 100644 index 0000000..9c84656 --- /dev/null +++ b/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.13 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a6ab42f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "swagger" +version = "1.0.0" +authors = ["Swagger Codegen team and contributors"] + +[dependencies] +serde = "1.0" +serde_derive = "1.0" +serde_yaml = "0.7" +serde_json = "1.0" +base64 = "~0.7.0" +futures = "0.1.16" +hyper = "0.11.6" +url = "1.5" + +[dev-dependencies] +tokio-core = "*" diff --git a/README.md b/README.md new file mode 100644 index 0000000..4bb8dae --- /dev/null +++ b/README.md @@ -0,0 +1,420 @@ +# Rust API client for swagger + +This documentation describes the Gitea API. + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 1.1.1 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.languages.RustClientCodegen + +## Installation +Put the package under your project folder and add the following in import: +``` + "./swagger" +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost/api/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AdminApi* | [**admin_create_org**](docs/AdminApi.md#admin_create_org) | **Post** /admin/users/{username}/orgs | Create an organization +*AdminApi* | [**admin_create_public_key**](docs/AdminApi.md#admin_create_public_key) | **Post** /admin/users/{username}/keys | Add a public key on behalf of a user +*AdminApi* | [**admin_create_repo**](docs/AdminApi.md#admin_create_repo) | **Post** /admin/users/{username}/repos | Create a repository on behalf a user +*AdminApi* | [**admin_create_user**](docs/AdminApi.md#admin_create_user) | **Post** /admin/users | Create a user +*AdminApi* | [**admin_delete_user**](docs/AdminApi.md#admin_delete_user) | **Delete** /admin/users/{username} | Delete a user +*AdminApi* | [**admin_delete_user_public_key**](docs/AdminApi.md#admin_delete_user_public_key) | **Delete** /admin/users/{username}/keys/{id} | Delete a user's public key +*AdminApi* | [**admin_edit_user**](docs/AdminApi.md#admin_edit_user) | **Patch** /admin/users/{username} | Edit an existing user +*AdminApi* | [**admin_get_all_orgs**](docs/AdminApi.md#admin_get_all_orgs) | **Get** /admin/orgs | List all organizations +*AdminApi* | [**admin_get_all_users**](docs/AdminApi.md#admin_get_all_users) | **Get** /admin/users | List all users +*IssueApi* | [**issue_add_label**](docs/IssueApi.md#issue_add_label) | **Post** /repos/{owner}/{repo}/issues/{index}/labels | Add a label to an issue +*IssueApi* | [**issue_add_subscription**](docs/IssueApi.md#issue_add_subscription) | **Put** /repos/{owner}/{repo}/issues/{index}/subscriptions/{user} | Subscribe user to issue +*IssueApi* | [**issue_add_time**](docs/IssueApi.md#issue_add_time) | **Post** /repos/{owner}/{repo}/issues/{index}/times | Add tracked time to a issue +*IssueApi* | [**issue_clear_labels**](docs/IssueApi.md#issue_clear_labels) | **Delete** /repos/{owner}/{repo}/issues/{index}/labels | Remove all labels from an issue +*IssueApi* | [**issue_create_comment**](docs/IssueApi.md#issue_create_comment) | **Post** /repos/{owner}/{repo}/issues/{index}/comments | Add a comment to an issue +*IssueApi* | [**issue_create_issue**](docs/IssueApi.md#issue_create_issue) | **Post** /repos/{owner}/{repo}/issues | Create an issue. If using deadline only the date will be taken into account, and time of day ignored. +*IssueApi* | [**issue_create_label**](docs/IssueApi.md#issue_create_label) | **Post** /repos/{owner}/{repo}/labels | Create a label +*IssueApi* | [**issue_create_milestone**](docs/IssueApi.md#issue_create_milestone) | **Post** /repos/{owner}/{repo}/milestones | Create a milestone +*IssueApi* | [**issue_delete_comment**](docs/IssueApi.md#issue_delete_comment) | **Delete** /repos/{owner}/{repo}/issues/comments/{id} | Delete a comment +*IssueApi* | [**issue_delete_comment_deprecated**](docs/IssueApi.md#issue_delete_comment_deprecated) | **Delete** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Delete a comment +*IssueApi* | [**issue_delete_comment_reaction**](docs/IssueApi.md#issue_delete_comment_reaction) | **Delete** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Remove a reaction from a comment of an issue +*IssueApi* | [**issue_delete_issue_reaction**](docs/IssueApi.md#issue_delete_issue_reaction) | **Delete** /repos/{owner}/{repo}/issues/{index}/reactions | Remove a reaction from an issue +*IssueApi* | [**issue_delete_label**](docs/IssueApi.md#issue_delete_label) | **Delete** /repos/{owner}/{repo}/labels/{id} | Delete a label +*IssueApi* | [**issue_delete_milestone**](docs/IssueApi.md#issue_delete_milestone) | **Delete** /repos/{owner}/{repo}/milestones/{id} | Delete a milestone +*IssueApi* | [**issue_delete_stop_watch**](docs/IssueApi.md#issue_delete_stop_watch) | **Delete** /repos/{owner}/{repo}/issues/{index}/stopwatch/delete | Delete an issue's existing stopwatch. +*IssueApi* | [**issue_delete_subscription**](docs/IssueApi.md#issue_delete_subscription) | **Delete** /repos/{owner}/{repo}/issues/{index}/subscriptions/{user} | Unsubscribe user from issue +*IssueApi* | [**issue_delete_time**](docs/IssueApi.md#issue_delete_time) | **Delete** /repos/{owner}/{repo}/issues/{index}/times/{id} | Delete specific tracked time +*IssueApi* | [**issue_edit_comment**](docs/IssueApi.md#issue_edit_comment) | **Patch** /repos/{owner}/{repo}/issues/comments/{id} | Edit a comment +*IssueApi* | [**issue_edit_comment_deprecated**](docs/IssueApi.md#issue_edit_comment_deprecated) | **Patch** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Edit a comment +*IssueApi* | [**issue_edit_issue**](docs/IssueApi.md#issue_edit_issue) | **Patch** /repos/{owner}/{repo}/issues/{index} | Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. +*IssueApi* | [**issue_edit_issue_deadline**](docs/IssueApi.md#issue_edit_issue_deadline) | **Post** /repos/{owner}/{repo}/issues/{index}/deadline | Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. +*IssueApi* | [**issue_edit_label**](docs/IssueApi.md#issue_edit_label) | **Patch** /repos/{owner}/{repo}/labels/{id} | Update a label +*IssueApi* | [**issue_edit_milestone**](docs/IssueApi.md#issue_edit_milestone) | **Patch** /repos/{owner}/{repo}/milestones/{id} | Update a milestone +*IssueApi* | [**issue_get_comment_reactions**](docs/IssueApi.md#issue_get_comment_reactions) | **Get** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Get a list of reactions from a comment of an issue +*IssueApi* | [**issue_get_comments**](docs/IssueApi.md#issue_get_comments) | **Get** /repos/{owner}/{repo}/issues/{index}/comments | List all comments on an issue +*IssueApi* | [**issue_get_issue**](docs/IssueApi.md#issue_get_issue) | **Get** /repos/{owner}/{repo}/issues/{index} | Get an issue +*IssueApi* | [**issue_get_issue_reactions**](docs/IssueApi.md#issue_get_issue_reactions) | **Get** /repos/{owner}/{repo}/issues/{index}/reactions | Get a list reactions of an issue +*IssueApi* | [**issue_get_label**](docs/IssueApi.md#issue_get_label) | **Get** /repos/{owner}/{repo}/labels/{id} | Get a single label +*IssueApi* | [**issue_get_labels**](docs/IssueApi.md#issue_get_labels) | **Get** /repos/{owner}/{repo}/issues/{index}/labels | Get an issue's labels +*IssueApi* | [**issue_get_milestone**](docs/IssueApi.md#issue_get_milestone) | **Get** /repos/{owner}/{repo}/milestones/{id} | Get a milestone +*IssueApi* | [**issue_get_milestones_list**](docs/IssueApi.md#issue_get_milestones_list) | **Get** /repos/{owner}/{repo}/milestones | Get all of a repository's opened milestones +*IssueApi* | [**issue_get_repo_comments**](docs/IssueApi.md#issue_get_repo_comments) | **Get** /repos/{owner}/{repo}/issues/comments | List all comments in a repository +*IssueApi* | [**issue_list_issues**](docs/IssueApi.md#issue_list_issues) | **Get** /repos/{owner}/{repo}/issues | List a repository's issues +*IssueApi* | [**issue_list_labels**](docs/IssueApi.md#issue_list_labels) | **Get** /repos/{owner}/{repo}/labels | Get all of a repository's labels +*IssueApi* | [**issue_post_comment_reaction**](docs/IssueApi.md#issue_post_comment_reaction) | **Post** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Add a reaction to a comment of an issue +*IssueApi* | [**issue_post_issue_reaction**](docs/IssueApi.md#issue_post_issue_reaction) | **Post** /repos/{owner}/{repo}/issues/{index}/reactions | Add a reaction to an issue +*IssueApi* | [**issue_remove_label**](docs/IssueApi.md#issue_remove_label) | **Delete** /repos/{owner}/{repo}/issues/{index}/labels/{id} | Remove a label from an issue +*IssueApi* | [**issue_replace_labels**](docs/IssueApi.md#issue_replace_labels) | **Put** /repos/{owner}/{repo}/issues/{index}/labels | Replace an issue's labels +*IssueApi* | [**issue_reset_time**](docs/IssueApi.md#issue_reset_time) | **Delete** /repos/{owner}/{repo}/issues/{index}/times | Reset a tracked time of an issue +*IssueApi* | [**issue_search_issues**](docs/IssueApi.md#issue_search_issues) | **Get** /repos/issues/search | Search for issues across the repositories that the user has access to +*IssueApi* | [**issue_start_stop_watch**](docs/IssueApi.md#issue_start_stop_watch) | **Post** /repos/{owner}/{repo}/issues/{index}/stopwatch/start | Start stopwatch on an issue. +*IssueApi* | [**issue_stop_stop_watch**](docs/IssueApi.md#issue_stop_stop_watch) | **Post** /repos/{owner}/{repo}/issues/{index}/stopwatch/stop | Stop an issue's existing stopwatch. +*IssueApi* | [**issue_subscriptions**](docs/IssueApi.md#issue_subscriptions) | **Get** /repos/{owner}/{repo}/issues/{index}/subscriptions | Get users who subscribed on an issue. +*IssueApi* | [**issue_tracked_times**](docs/IssueApi.md#issue_tracked_times) | **Get** /repos/{owner}/{repo}/issues/{index}/times | List an issue's tracked times +*MiscellaneousApi* | [**get_signing_key**](docs/MiscellaneousApi.md#get_signing_key) | **Get** /signing-key.gpg | Get default signing-key.gpg +*MiscellaneousApi* | [**get_version**](docs/MiscellaneousApi.md#get_version) | **Get** /version | Returns the version of the Gitea application +*MiscellaneousApi* | [**render_markdown**](docs/MiscellaneousApi.md#render_markdown) | **Post** /markdown | Render a markdown document as HTML +*MiscellaneousApi* | [**render_markdown_raw**](docs/MiscellaneousApi.md#render_markdown_raw) | **Post** /markdown/raw | Render raw markdown as HTML +*OrganizationApi* | [**create_org_repo**](docs/OrganizationApi.md#create_org_repo) | **Post** /org/{org}/repos | Create a repository in an organization +*OrganizationApi* | [**org_add_team_member**](docs/OrganizationApi.md#org_add_team_member) | **Put** /teams/{id}/members/{username} | Add a team member +*OrganizationApi* | [**org_add_team_repository**](docs/OrganizationApi.md#org_add_team_repository) | **Put** /teams/{id}/repos/{org}/{repo} | Add a repository to a team +*OrganizationApi* | [**org_conceal_member**](docs/OrganizationApi.md#org_conceal_member) | **Delete** /orgs/{org}/public_members/{username} | Conceal a user's membership +*OrganizationApi* | [**org_create**](docs/OrganizationApi.md#org_create) | **Post** /orgs | Create an organization +*OrganizationApi* | [**org_create_hook**](docs/OrganizationApi.md#org_create_hook) | **Post** /orgs/{org}/hooks/ | Create a hook +*OrganizationApi* | [**org_create_team**](docs/OrganizationApi.md#org_create_team) | **Post** /orgs/{org}/teams | Create a team +*OrganizationApi* | [**org_delete**](docs/OrganizationApi.md#org_delete) | **Delete** /orgs/{org} | Delete an organization +*OrganizationApi* | [**org_delete_hook**](docs/OrganizationApi.md#org_delete_hook) | **Delete** /orgs/{org}/hooks/{id} | Delete a hook +*OrganizationApi* | [**org_delete_member**](docs/OrganizationApi.md#org_delete_member) | **Delete** /orgs/{org}/members/{username} | Remove a member from an organization +*OrganizationApi* | [**org_delete_team**](docs/OrganizationApi.md#org_delete_team) | **Delete** /teams/{id} | Delete a team +*OrganizationApi* | [**org_edit**](docs/OrganizationApi.md#org_edit) | **Patch** /orgs/{org} | Edit an organization +*OrganizationApi* | [**org_edit_hook**](docs/OrganizationApi.md#org_edit_hook) | **Patch** /orgs/{org}/hooks/{id} | Update a hook +*OrganizationApi* | [**org_edit_team**](docs/OrganizationApi.md#org_edit_team) | **Patch** /teams/{id} | Edit a team +*OrganizationApi* | [**org_get**](docs/OrganizationApi.md#org_get) | **Get** /orgs/{org} | Get an organization +*OrganizationApi* | [**org_get_hook**](docs/OrganizationApi.md#org_get_hook) | **Get** /orgs/{org}/hooks/{id} | Get a hook +*OrganizationApi* | [**org_get_team**](docs/OrganizationApi.md#org_get_team) | **Get** /teams/{id} | Get a team +*OrganizationApi* | [**org_is_member**](docs/OrganizationApi.md#org_is_member) | **Get** /orgs/{org}/members/{username} | Check if a user is a member of an organization +*OrganizationApi* | [**org_is_public_member**](docs/OrganizationApi.md#org_is_public_member) | **Get** /orgs/{org}/public_members/{username} | Check if a user is a public member of an organization +*OrganizationApi* | [**org_list_current_user_orgs**](docs/OrganizationApi.md#org_list_current_user_orgs) | **Get** /user/orgs | List the current user's organizations +*OrganizationApi* | [**org_list_hooks**](docs/OrganizationApi.md#org_list_hooks) | **Get** /orgs/{org}/hooks | List an organization's webhooks +*OrganizationApi* | [**org_list_members**](docs/OrganizationApi.md#org_list_members) | **Get** /orgs/{org}/members | List an organization's members +*OrganizationApi* | [**org_list_public_members**](docs/OrganizationApi.md#org_list_public_members) | **Get** /orgs/{org}/public_members | List an organization's public members +*OrganizationApi* | [**org_list_repos**](docs/OrganizationApi.md#org_list_repos) | **Get** /orgs/{org}/repos | List an organization's repos +*OrganizationApi* | [**org_list_team_member**](docs/OrganizationApi.md#org_list_team_member) | **Get** /teams/{id}/members/{username} | List a particular member of team +*OrganizationApi* | [**org_list_team_members**](docs/OrganizationApi.md#org_list_team_members) | **Get** /teams/{id}/members | List a team's members +*OrganizationApi* | [**org_list_team_repos**](docs/OrganizationApi.md#org_list_team_repos) | **Get** /teams/{id}/repos | List a team's repos +*OrganizationApi* | [**org_list_teams**](docs/OrganizationApi.md#org_list_teams) | **Get** /orgs/{org}/teams | List an organization's teams +*OrganizationApi* | [**org_list_user_orgs**](docs/OrganizationApi.md#org_list_user_orgs) | **Get** /users/{username}/orgs | List a user's organizations +*OrganizationApi* | [**org_publicize_member**](docs/OrganizationApi.md#org_publicize_member) | **Put** /orgs/{org}/public_members/{username} | Publicize a user's membership +*OrganizationApi* | [**org_remove_team_member**](docs/OrganizationApi.md#org_remove_team_member) | **Delete** /teams/{id}/members/{username} | Remove a team member +*OrganizationApi* | [**org_remove_team_repository**](docs/OrganizationApi.md#org_remove_team_repository) | **Delete** /teams/{id}/repos/{org}/{repo} | Remove a repository from a team +*OrganizationApi* | [**team_search**](docs/OrganizationApi.md#team_search) | **Get** /orgs/{org}/teams/search | Search for teams within an organization +*RepositoryApi* | [**create_current_user_repo**](docs/RepositoryApi.md#create_current_user_repo) | **Post** /user/repos | Create a repository +*RepositoryApi* | [**create_fork**](docs/RepositoryApi.md#create_fork) | **Post** /repos/{owner}/{repo}/forks | Fork a repository +*RepositoryApi* | [**get_blob**](docs/RepositoryApi.md#get_blob) | **Get** /repos/{owner}/{repo}/git/blobs/{sha} | Gets the blob of a repository. +*RepositoryApi* | [**get_tag**](docs/RepositoryApi.md#get_tag) | **Get** /repos/{owner}/{repo}/git/tags/{sha} | Gets the tag object of an annotated tag (not lightweight tags) +*RepositoryApi* | [**get_tree**](docs/RepositoryApi.md#get_tree) | **Get** /repos/{owner}/{repo}/git/trees/{sha} | Gets the tree of a repository. +*RepositoryApi* | [**list_forks**](docs/RepositoryApi.md#list_forks) | **Get** /repos/{owner}/{repo}/forks | List a repository's forks +*RepositoryApi* | [**repo_add_collaborator**](docs/RepositoryApi.md#repo_add_collaborator) | **Put** /repos/{owner}/{repo}/collaborators/{collaborator} | Add a collaborator to a repository +*RepositoryApi* | [**repo_add_topc**](docs/RepositoryApi.md#repo_add_topc) | **Put** /repos/{owner}/{repo}/topics/{topic} | Add a topic to a repository +*RepositoryApi* | [**repo_check_collaborator**](docs/RepositoryApi.md#repo_check_collaborator) | **Get** /repos/{owner}/{repo}/collaborators/{collaborator} | Check if a user is a collaborator of a repository +*RepositoryApi* | [**repo_create_file**](docs/RepositoryApi.md#repo_create_file) | **Post** /repos/{owner}/{repo}/contents/{filepath} | Create a file in a repository +*RepositoryApi* | [**repo_create_hook**](docs/RepositoryApi.md#repo_create_hook) | **Post** /repos/{owner}/{repo}/hooks | Create a hook +*RepositoryApi* | [**repo_create_key**](docs/RepositoryApi.md#repo_create_key) | **Post** /repos/{owner}/{repo}/keys | Add a key to a repository +*RepositoryApi* | [**repo_create_pull_request**](docs/RepositoryApi.md#repo_create_pull_request) | **Post** /repos/{owner}/{repo}/pulls | Create a pull request +*RepositoryApi* | [**repo_create_release**](docs/RepositoryApi.md#repo_create_release) | **Post** /repos/{owner}/{repo}/releases | Create a release +*RepositoryApi* | [**repo_create_release_attachment**](docs/RepositoryApi.md#repo_create_release_attachment) | **Post** /repos/{owner}/{repo}/releases/{id}/assets | Create a release attachment +*RepositoryApi* | [**repo_create_status**](docs/RepositoryApi.md#repo_create_status) | **Post** /repos/{owner}/{repo}/statuses/{sha} | Create a commit status +*RepositoryApi* | [**repo_delete**](docs/RepositoryApi.md#repo_delete) | **Delete** /repos/{owner}/{repo} | Delete a repository +*RepositoryApi* | [**repo_delete_collaborator**](docs/RepositoryApi.md#repo_delete_collaborator) | **Delete** /repos/{owner}/{repo}/collaborators/{collaborator} | Delete a collaborator from a repository +*RepositoryApi* | [**repo_delete_file**](docs/RepositoryApi.md#repo_delete_file) | **Delete** /repos/{owner}/{repo}/contents/{filepath} | Delete a file in a repository +*RepositoryApi* | [**repo_delete_git_hook**](docs/RepositoryApi.md#repo_delete_git_hook) | **Delete** /repos/{owner}/{repo}/hooks/git/{id} | Delete a Git hook in a repository +*RepositoryApi* | [**repo_delete_hook**](docs/RepositoryApi.md#repo_delete_hook) | **Delete** /repos/{owner}/{repo}/hooks/{id} | Delete a hook in a repository +*RepositoryApi* | [**repo_delete_key**](docs/RepositoryApi.md#repo_delete_key) | **Delete** /repos/{owner}/{repo}/keys/{id} | Delete a key from a repository +*RepositoryApi* | [**repo_delete_release**](docs/RepositoryApi.md#repo_delete_release) | **Delete** /repos/{owner}/{repo}/releases/{id} | Delete a release +*RepositoryApi* | [**repo_delete_release_attachment**](docs/RepositoryApi.md#repo_delete_release_attachment) | **Delete** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Delete a release attachment +*RepositoryApi* | [**repo_delete_topic**](docs/RepositoryApi.md#repo_delete_topic) | **Delete** /repos/{owner}/{repo}/topics/{topic} | Delete a topic from a repository +*RepositoryApi* | [**repo_edit**](docs/RepositoryApi.md#repo_edit) | **Patch** /repos/{owner}/{repo} | Edit a repository's properties. Only fields that are set will be changed. +*RepositoryApi* | [**repo_edit_git_hook**](docs/RepositoryApi.md#repo_edit_git_hook) | **Patch** /repos/{owner}/{repo}/hooks/git/{id} | Edit a Git hook in a repository +*RepositoryApi* | [**repo_edit_hook**](docs/RepositoryApi.md#repo_edit_hook) | **Patch** /repos/{owner}/{repo}/hooks/{id} | Edit a hook in a repository +*RepositoryApi* | [**repo_edit_pull_request**](docs/RepositoryApi.md#repo_edit_pull_request) | **Patch** /repos/{owner}/{repo}/pulls/{index} | Update a pull request. If using deadline only the date will be taken into account, and time of day ignored. +*RepositoryApi* | [**repo_edit_release**](docs/RepositoryApi.md#repo_edit_release) | **Patch** /repos/{owner}/{repo}/releases/{id} | Update a release +*RepositoryApi* | [**repo_edit_release_attachment**](docs/RepositoryApi.md#repo_edit_release_attachment) | **Patch** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Edit a release attachment +*RepositoryApi* | [**repo_get**](docs/RepositoryApi.md#repo_get) | **Get** /repos/{owner}/{repo} | Get a repository +*RepositoryApi* | [**repo_get_all_commits**](docs/RepositoryApi.md#repo_get_all_commits) | **Get** /repos/{owner}/{repo}/commits | Get a list of all commits from a repository +*RepositoryApi* | [**repo_get_archive**](docs/RepositoryApi.md#repo_get_archive) | **Get** /repos/{owner}/{repo}/archive/{archive} | Get an archive of a repository +*RepositoryApi* | [**repo_get_branch**](docs/RepositoryApi.md#repo_get_branch) | **Get** /repos/{owner}/{repo}/branches/{branch} | Retrieve a specific branch from a repository, including its effective branch protection +*RepositoryApi* | [**repo_get_by_id**](docs/RepositoryApi.md#repo_get_by_id) | **Get** /repositories/{id} | Get a repository by id +*RepositoryApi* | [**repo_get_combined_status_by_ref**](docs/RepositoryApi.md#repo_get_combined_status_by_ref) | **Get** /repos/{owner}/{repo}/commits/{ref}/statuses | Get a commit's combined status, by branch/tag/commit reference +*RepositoryApi* | [**repo_get_contents**](docs/RepositoryApi.md#repo_get_contents) | **Get** /repos/{owner}/{repo}/contents/{filepath} | Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir +*RepositoryApi* | [**repo_get_contents_list**](docs/RepositoryApi.md#repo_get_contents_list) | **Get** /repos/{owner}/{repo}/contents | Gets the metadata of all the entries of the root dir +*RepositoryApi* | [**repo_get_editor_config**](docs/RepositoryApi.md#repo_get_editor_config) | **Get** /repos/{owner}/{repo}/editorconfig/{filepath} | Get the EditorConfig definitions of a file in a repository +*RepositoryApi* | [**repo_get_git_hook**](docs/RepositoryApi.md#repo_get_git_hook) | **Get** /repos/{owner}/{repo}/hooks/git/{id} | Get a Git hook +*RepositoryApi* | [**repo_get_hook**](docs/RepositoryApi.md#repo_get_hook) | **Get** /repos/{owner}/{repo}/hooks/{id} | Get a hook +*RepositoryApi* | [**repo_get_key**](docs/RepositoryApi.md#repo_get_key) | **Get** /repos/{owner}/{repo}/keys/{id} | Get a repository's key by id +*RepositoryApi* | [**repo_get_pull_request**](docs/RepositoryApi.md#repo_get_pull_request) | **Get** /repos/{owner}/{repo}/pulls/{index} | Get a pull request +*RepositoryApi* | [**repo_get_raw_file**](docs/RepositoryApi.md#repo_get_raw_file) | **Get** /repos/{owner}/{repo}/raw/{filepath} | Get a file from a repository +*RepositoryApi* | [**repo_get_release**](docs/RepositoryApi.md#repo_get_release) | **Get** /repos/{owner}/{repo}/releases/{id} | Get a release +*RepositoryApi* | [**repo_get_release_attachment**](docs/RepositoryApi.md#repo_get_release_attachment) | **Get** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Get a release attachment +*RepositoryApi* | [**repo_get_single_commit**](docs/RepositoryApi.md#repo_get_single_commit) | **Get** /repos/{owner}/{repo}/git/commits/{sha} | Get a single commit from a repository +*RepositoryApi* | [**repo_list_all_git_refs**](docs/RepositoryApi.md#repo_list_all_git_refs) | **Get** /repos/{owner}/{repo}/git/refs | Get specified ref or filtered repository's refs +*RepositoryApi* | [**repo_list_branches**](docs/RepositoryApi.md#repo_list_branches) | **Get** /repos/{owner}/{repo}/branches | List a repository's branches +*RepositoryApi* | [**repo_list_collaborators**](docs/RepositoryApi.md#repo_list_collaborators) | **Get** /repos/{owner}/{repo}/collaborators | List a repository's collaborators +*RepositoryApi* | [**repo_list_git_hooks**](docs/RepositoryApi.md#repo_list_git_hooks) | **Get** /repos/{owner}/{repo}/hooks/git | List the Git hooks in a repository +*RepositoryApi* | [**repo_list_git_refs**](docs/RepositoryApi.md#repo_list_git_refs) | **Get** /repos/{owner}/{repo}/git/refs/{ref} | Get specified ref or filtered repository's refs +*RepositoryApi* | [**repo_list_hooks**](docs/RepositoryApi.md#repo_list_hooks) | **Get** /repos/{owner}/{repo}/hooks | List the hooks in a repository +*RepositoryApi* | [**repo_list_keys**](docs/RepositoryApi.md#repo_list_keys) | **Get** /repos/{owner}/{repo}/keys | List a repository's keys +*RepositoryApi* | [**repo_list_pull_requests**](docs/RepositoryApi.md#repo_list_pull_requests) | **Get** /repos/{owner}/{repo}/pulls | List a repo's pull requests +*RepositoryApi* | [**repo_list_release_attachments**](docs/RepositoryApi.md#repo_list_release_attachments) | **Get** /repos/{owner}/{repo}/releases/{id}/assets | List release's attachments +*RepositoryApi* | [**repo_list_releases**](docs/RepositoryApi.md#repo_list_releases) | **Get** /repos/{owner}/{repo}/releases | List a repo's releases +*RepositoryApi* | [**repo_list_stargazers**](docs/RepositoryApi.md#repo_list_stargazers) | **Get** /repos/{owner}/{repo}/stargazers | List a repo's stargazers +*RepositoryApi* | [**repo_list_statuses**](docs/RepositoryApi.md#repo_list_statuses) | **Get** /repos/{owner}/{repo}/statuses/{sha} | Get a commit's statuses +*RepositoryApi* | [**repo_list_subscribers**](docs/RepositoryApi.md#repo_list_subscribers) | **Get** /repos/{owner}/{repo}/subscribers | List a repo's watchers +*RepositoryApi* | [**repo_list_tags**](docs/RepositoryApi.md#repo_list_tags) | **Get** /repos/{owner}/{repo}/tags | List a repository's tags +*RepositoryApi* | [**repo_list_topics**](docs/RepositoryApi.md#repo_list_topics) | **Get** /repos/{owner}/{repo}/topics | Get list of topics that a repository has +*RepositoryApi* | [**repo_merge_pull_request**](docs/RepositoryApi.md#repo_merge_pull_request) | **Post** /repos/{owner}/{repo}/pulls/{index}/merge | Merge a pull request +*RepositoryApi* | [**repo_migrate**](docs/RepositoryApi.md#repo_migrate) | **Post** /repos/migrate | Migrate a remote git repository +*RepositoryApi* | [**repo_mirror_sync**](docs/RepositoryApi.md#repo_mirror_sync) | **Post** /repos/{owner}/{repo}/mirror-sync | Sync a mirrored repository +*RepositoryApi* | [**repo_pull_request_is_merged**](docs/RepositoryApi.md#repo_pull_request_is_merged) | **Get** /repos/{owner}/{repo}/pulls/{index}/merge | Check if a pull request has been merged +*RepositoryApi* | [**repo_search**](docs/RepositoryApi.md#repo_search) | **Get** /repos/search | Search for repositories +*RepositoryApi* | [**repo_signing_key**](docs/RepositoryApi.md#repo_signing_key) | **Get** /repos/{owner}/{repo}/signing-key.gpg | Get signing-key.gpg for given repository +*RepositoryApi* | [**repo_test_hook**](docs/RepositoryApi.md#repo_test_hook) | **Post** /repos/{owner}/{repo}/hooks/{id}/tests | Test a push webhook +*RepositoryApi* | [**repo_tracked_times**](docs/RepositoryApi.md#repo_tracked_times) | **Get** /repos/{owner}/{repo}/times | List a repo's tracked times +*RepositoryApi* | [**repo_update_file**](docs/RepositoryApi.md#repo_update_file) | **Put** /repos/{owner}/{repo}/contents/{filepath} | Update a file in a repository +*RepositoryApi* | [**repo_update_topics**](docs/RepositoryApi.md#repo_update_topics) | **Put** /repos/{owner}/{repo}/topics | Replace list of topics for a repository +*RepositoryApi* | [**topic_search**](docs/RepositoryApi.md#topic_search) | **Get** /topics/search | search topics via keyword +*RepositoryApi* | [**user_current_check_subscription**](docs/RepositoryApi.md#user_current_check_subscription) | **Get** /repos/{owner}/{repo}/subscription | Check if the current user is watching a repo +*RepositoryApi* | [**user_current_delete_subscription**](docs/RepositoryApi.md#user_current_delete_subscription) | **Delete** /repos/{owner}/{repo}/subscription | Unwatch a repo +*RepositoryApi* | [**user_current_put_subscription**](docs/RepositoryApi.md#user_current_put_subscription) | **Put** /repos/{owner}/{repo}/subscription | Watch a repo +*UserApi* | [**create_current_user_repo**](docs/UserApi.md#create_current_user_repo) | **Post** /user/repos | Create a repository +*UserApi* | [**user_add_email**](docs/UserApi.md#user_add_email) | **Post** /user/emails | Add email addresses +*UserApi* | [**user_check_following**](docs/UserApi.md#user_check_following) | **Get** /users/{follower}/following/{followee} | Check if one user is following another user +*UserApi* | [**user_create_token**](docs/UserApi.md#user_create_token) | **Post** /users/{username}/tokens | Create an access token +*UserApi* | [**user_current_check_following**](docs/UserApi.md#user_current_check_following) | **Get** /user/following/{username} | Check whether a user is followed by the authenticated user +*UserApi* | [**user_current_check_starring**](docs/UserApi.md#user_current_check_starring) | **Get** /user/starred/{owner}/{repo} | Whether the authenticated is starring the repo +*UserApi* | [**user_current_delete_follow**](docs/UserApi.md#user_current_delete_follow) | **Delete** /user/following/{username} | Unfollow a user +*UserApi* | [**user_current_delete_gpg_key**](docs/UserApi.md#user_current_delete_gpg_key) | **Delete** /user/gpg_keys/{id} | Remove a GPG key +*UserApi* | [**user_current_delete_key**](docs/UserApi.md#user_current_delete_key) | **Delete** /user/keys/{id} | Delete a public key +*UserApi* | [**user_current_delete_star**](docs/UserApi.md#user_current_delete_star) | **Delete** /user/starred/{owner}/{repo} | Unstar the given repo +*UserApi* | [**user_current_get_gpg_key**](docs/UserApi.md#user_current_get_gpg_key) | **Get** /user/gpg_keys/{id} | Get a GPG key +*UserApi* | [**user_current_get_key**](docs/UserApi.md#user_current_get_key) | **Get** /user/keys/{id} | Get a public key +*UserApi* | [**user_current_list_followers**](docs/UserApi.md#user_current_list_followers) | **Get** /user/followers | List the authenticated user's followers +*UserApi* | [**user_current_list_following**](docs/UserApi.md#user_current_list_following) | **Get** /user/following | List the users that the authenticated user is following +*UserApi* | [**user_current_list_gpg_keys**](docs/UserApi.md#user_current_list_gpg_keys) | **Get** /user/gpg_keys | List the authenticated user's GPG keys +*UserApi* | [**user_current_list_keys**](docs/UserApi.md#user_current_list_keys) | **Get** /user/keys | List the authenticated user's public keys +*UserApi* | [**user_current_list_repos**](docs/UserApi.md#user_current_list_repos) | **Get** /user/repos | List the repos that the authenticated user owns or has access to +*UserApi* | [**user_current_list_starred**](docs/UserApi.md#user_current_list_starred) | **Get** /user/starred | The repos that the authenticated user has starred +*UserApi* | [**user_current_list_subscriptions**](docs/UserApi.md#user_current_list_subscriptions) | **Get** /user/subscriptions | List repositories watched by the authenticated user +*UserApi* | [**user_current_post_gpg_key**](docs/UserApi.md#user_current_post_gpg_key) | **Post** /user/gpg_keys | Create a GPG key +*UserApi* | [**user_current_post_key**](docs/UserApi.md#user_current_post_key) | **Post** /user/keys | Create a public key +*UserApi* | [**user_current_put_follow**](docs/UserApi.md#user_current_put_follow) | **Put** /user/following/{username} | Follow a user +*UserApi* | [**user_current_put_star**](docs/UserApi.md#user_current_put_star) | **Put** /user/starred/{owner}/{repo} | Star the given repo +*UserApi* | [**user_current_tracked_times**](docs/UserApi.md#user_current_tracked_times) | **Get** /user/times | List the current user's tracked times +*UserApi* | [**user_delete_access_token**](docs/UserApi.md#user_delete_access_token) | **Delete** /users/{username}/tokens/{token} | delete an access token +*UserApi* | [**user_delete_email**](docs/UserApi.md#user_delete_email) | **Delete** /user/emails | Delete email addresses +*UserApi* | [**user_get**](docs/UserApi.md#user_get) | **Get** /users/{username} | Get a user +*UserApi* | [**user_get_current**](docs/UserApi.md#user_get_current) | **Get** /user | Get the authenticated user +*UserApi* | [**user_get_heatmap_data**](docs/UserApi.md#user_get_heatmap_data) | **Get** /users/{username}/heatmap | Get a user's heatmap +*UserApi* | [**user_get_stop_watches**](docs/UserApi.md#user_get_stop_watches) | **Get** /user/stopwatches | Get list of all existing stopwatches +*UserApi* | [**user_get_tokens**](docs/UserApi.md#user_get_tokens) | **Get** /users/{username}/tokens | List the authenticated user's access tokens +*UserApi* | [**user_list_emails**](docs/UserApi.md#user_list_emails) | **Get** /user/emails | List the authenticated user's email addresses +*UserApi* | [**user_list_followers**](docs/UserApi.md#user_list_followers) | **Get** /users/{username}/followers | List the given user's followers +*UserApi* | [**user_list_following**](docs/UserApi.md#user_list_following) | **Get** /users/{username}/following | List the users that the given user is following +*UserApi* | [**user_list_gpg_keys**](docs/UserApi.md#user_list_gpg_keys) | **Get** /users/{username}/gpg_keys | List the given user's GPG keys +*UserApi* | [**user_list_keys**](docs/UserApi.md#user_list_keys) | **Get** /users/{username}/keys | List the given user's public keys +*UserApi* | [**user_list_repos**](docs/UserApi.md#user_list_repos) | **Get** /users/{username}/repos | List the repos owned by the given user +*UserApi* | [**user_list_starred**](docs/UserApi.md#user_list_starred) | **Get** /users/{username}/starred | The repos that the given user has starred +*UserApi* | [**user_list_subscriptions**](docs/UserApi.md#user_list_subscriptions) | **Get** /users/{username}/subscriptions | List the repositories watched by a user +*UserApi* | [**user_list_teams**](docs/UserApi.md#user_list_teams) | **Get** /user/teams | List all the teams a user belongs to +*UserApi* | [**user_search**](docs/UserApi.md#user_search) | **Get** /users/search | Search for users +*UserApi* | [**user_tracked_times**](docs/UserApi.md#user_tracked_times) | **Get** /repos/{owner}/{repo}/times/{user} | List a user's tracked times in a repo + + +## Documentation For Models + + - [AccessToken](docs/AccessToken.md) + - [AddCollaboratorOption](docs/AddCollaboratorOption.md) + - [AddTimeOption](docs/AddTimeOption.md) + - [AnnotatedTag](docs/AnnotatedTag.md) + - [AnnotatedTagObject](docs/AnnotatedTagObject.md) + - [ApiError](docs/ApiError.md) + - [Attachment](docs/Attachment.md) + - [Branch](docs/Branch.md) + - [Comment](docs/Comment.md) + - [Commit](docs/Commit.md) + - [CommitDateOptions](docs/CommitDateOptions.md) + - [CommitMeta](docs/CommitMeta.md) + - [CommitUser](docs/CommitUser.md) + - [ContentsResponse](docs/ContentsResponse.md) + - [CreateEmailOption](docs/CreateEmailOption.md) + - [CreateFileOptions](docs/CreateFileOptions.md) + - [CreateForkOption](docs/CreateForkOption.md) + - [CreateGpgKeyOption](docs/CreateGpgKeyOption.md) + - [CreateHookOption](docs/CreateHookOption.md) + - [CreateHookOptionConfig](docs/CreateHookOptionConfig.md) + - [CreateIssueCommentOption](docs/CreateIssueCommentOption.md) + - [CreateIssueOption](docs/CreateIssueOption.md) + - [CreateKeyOption](docs/CreateKeyOption.md) + - [CreateLabelOption](docs/CreateLabelOption.md) + - [CreateMilestoneOption](docs/CreateMilestoneOption.md) + - [CreateOrgOption](docs/CreateOrgOption.md) + - [CreatePullRequestOption](docs/CreatePullRequestOption.md) + - [CreateReleaseOption](docs/CreateReleaseOption.md) + - [CreateRepoOption](docs/CreateRepoOption.md) + - [CreateStatusOption](docs/CreateStatusOption.md) + - [CreateTeamOption](docs/CreateTeamOption.md) + - [CreateUserOption](docs/CreateUserOption.md) + - [DeleteEmailOption](docs/DeleteEmailOption.md) + - [DeleteFileOptions](docs/DeleteFileOptions.md) + - [DeployKey](docs/DeployKey.md) + - [EditAttachmentOptions](docs/EditAttachmentOptions.md) + - [EditDeadlineOption](docs/EditDeadlineOption.md) + - [EditGitHookOption](docs/EditGitHookOption.md) + - [EditHookOption](docs/EditHookOption.md) + - [EditIssueCommentOption](docs/EditIssueCommentOption.md) + - [EditIssueOption](docs/EditIssueOption.md) + - [EditLabelOption](docs/EditLabelOption.md) + - [EditMilestoneOption](docs/EditMilestoneOption.md) + - [EditOrgOption](docs/EditOrgOption.md) + - [EditPullRequestOption](docs/EditPullRequestOption.md) + - [EditReactionOption](docs/EditReactionOption.md) + - [EditReleaseOption](docs/EditReleaseOption.md) + - [EditRepoOption](docs/EditRepoOption.md) + - [EditTeamOption](docs/EditTeamOption.md) + - [EditUserOption](docs/EditUserOption.md) + - [Email](docs/Email.md) + - [ExternalTracker](docs/ExternalTracker.md) + - [ExternalWiki](docs/ExternalWiki.md) + - [FileCommitResponse](docs/FileCommitResponse.md) + - [FileDeleteResponse](docs/FileDeleteResponse.md) + - [FileLinksResponse](docs/FileLinksResponse.md) + - [FileResponse](docs/FileResponse.md) + - [GitBlobResponse](docs/GitBlobResponse.md) + - [GitEntry](docs/GitEntry.md) + - [GitHook](docs/GitHook.md) + - [GitObject](docs/GitObject.md) + - [GitTreeResponse](docs/GitTreeResponse.md) + - [GpgKey](docs/GpgKey.md) + - [GpgKeyEmail](docs/GpgKeyEmail.md) + - [Hook](docs/Hook.md) + - [Identity](docs/Identity.md) + - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse2001](docs/InlineResponse2001.md) + - [InternalTracker](docs/InternalTracker.md) + - [Issue](docs/Issue.md) + - [IssueDeadline](docs/IssueDeadline.md) + - [IssueLabelsOption](docs/IssueLabelsOption.md) + - [Label](docs/Label.md) + - [MarkdownOption](docs/MarkdownOption.md) + - [MergePullRequestOption](docs/MergePullRequestOption.md) + - [MigrateRepoForm](docs/MigrateRepoForm.md) + - [Milestone](docs/Milestone.md) + - [Organization](docs/Organization.md) + - [PayloadCommit](docs/PayloadCommit.md) + - [PayloadCommitVerification](docs/PayloadCommitVerification.md) + - [PayloadUser](docs/PayloadUser.md) + - [Permission](docs/Permission.md) + - [PrBranchInfo](docs/PrBranchInfo.md) + - [PublicKey](docs/PublicKey.md) + - [PullRequest](docs/PullRequest.md) + - [PullRequestMeta](docs/PullRequestMeta.md) + - [Reaction](docs/Reaction.md) + - [Reference](docs/Reference.md) + - [Release](docs/Release.md) + - [RepoCommit](docs/RepoCommit.md) + - [RepoTopicOptions](docs/RepoTopicOptions.md) + - [Repository](docs/Repository.md) + - [RepositoryMeta](docs/RepositoryMeta.md) + - [SearchResults](docs/SearchResults.md) + - [ServerVersion](docs/ServerVersion.md) + - [StateType](docs/StateType.md) + - [Status](docs/Status.md) + - [StatusState](docs/StatusState.md) + - [StopWatch](docs/StopWatch.md) + - [Tag](docs/Tag.md) + - [Team](docs/Team.md) + - [TimeStamp](docs/TimeStamp.md) + - [TopicName](docs/TopicName.md) + - [TopicResponse](docs/TopicResponse.md) + - [TrackedTime](docs/TrackedTime.md) + - [UpdateFileOptions](docs/UpdateFileOptions.md) + - [User](docs/User.md) + - [UserHeatmapData](docs/UserHeatmapData.md) + - [WatchInfo](docs/WatchInfo.md) + + +## Documentation For Authorization + +## AccessToken +- **Type**: API key + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. + }) + r, err := client.Service.Operation(auth, args) +``` +## AuthorizationHeaderToken +- **Type**: API key + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. + }) + r, err := client.Service.Operation(auth, args) +``` +## BasicAuth +- **Type**: HTTP basic authentication + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", + }) + r, err := client.Service.Operation(auth, args) +``` +## SudoHeader +- **Type**: API key + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. + }) + r, err := client.Service.Operation(auth, args) +``` +## SudoParam +- **Type**: API key + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. + }) + r, err := client.Service.Operation(auth, args) +``` +## Token +- **Type**: API key + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. + }) + r, err := client.Service.Operation(auth, args) +``` + +## Author + + + diff --git a/docs/AccessToken.md b/docs/AccessToken.md new file mode 100644 index 0000000..7c74bce --- /dev/null +++ b/docs/AccessToken.md @@ -0,0 +1,10 @@ +# AccessToken + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AddCollaboratorOption.md b/docs/AddCollaboratorOption.md new file mode 100644 index 0000000..80f9d03 --- /dev/null +++ b/docs/AddCollaboratorOption.md @@ -0,0 +1,10 @@ +# AddCollaboratorOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**permission** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AddTimeOption.md b/docs/AddTimeOption.md new file mode 100644 index 0000000..218f160 --- /dev/null +++ b/docs/AddTimeOption.md @@ -0,0 +1,12 @@ +# AddTimeOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | **String** | | [optional] [default to null] +**time** | **i64** | time in seconds | [default to null] +**user_name** | **String** | User who spent the time (optional) | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AdminApi.md b/docs/AdminApi.md new file mode 100644 index 0000000..f18b714 --- /dev/null +++ b/docs/AdminApi.md @@ -0,0 +1,323 @@ +# \AdminApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**admin_create_org**](AdminApi.md#admin_create_org) | **Post** /admin/users/{username}/orgs | Create an organization +[**admin_create_public_key**](AdminApi.md#admin_create_public_key) | **Post** /admin/users/{username}/keys | Add a public key on behalf of a user +[**admin_create_repo**](AdminApi.md#admin_create_repo) | **Post** /admin/users/{username}/repos | Create a repository on behalf a user +[**admin_create_user**](AdminApi.md#admin_create_user) | **Post** /admin/users | Create a user +[**admin_delete_user**](AdminApi.md#admin_delete_user) | **Delete** /admin/users/{username} | Delete a user +[**admin_delete_user_public_key**](AdminApi.md#admin_delete_user_public_key) | **Delete** /admin/users/{username}/keys/{id} | Delete a user's public key +[**admin_edit_user**](AdminApi.md#admin_edit_user) | **Patch** /admin/users/{username} | Edit an existing user +[**admin_get_all_orgs**](AdminApi.md#admin_get_all_orgs) | **Get** /admin/orgs | List all organizations +[**admin_get_all_users**](AdminApi.md#admin_get_all_users) | **Get** /admin/users | List all users + + +# **admin_create_org** +> ::models::Organization admin_create_org(ctx, ctx, ctx, ctx, ctx, ctx, username, organization) +Create an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of the user that will own the created organization | + **organization** | [**CreateOrgOption**](CreateOrgOption.md)| | + +### Return type + +[**::models::Organization**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **admin_create_public_key** +> ::models::PublicKey admin_create_public_key(ctx, ctx, ctx, ctx, ctx, ctx, username, optional) +Add a public key on behalf of a user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of the user | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of the user | + **key** | [**CreateKeyOption**](CreateKeyOption.md)| | + +### Return type + +[**::models::PublicKey**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **admin_create_repo** +> ::models::Repository admin_create_repo(ctx, ctx, ctx, ctx, ctx, ctx, username, repository) +Create a repository on behalf a user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of the user. This user will own the created repository | + **repository** | [**CreateRepoOption**](CreateRepoOption.md)| | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **admin_create_user** +> ::models::User admin_create_user(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Create a user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateUserOption**](CreateUserOption.md)| | + +### Return type + +[**::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **admin_delete_user** +> admin_delete_user(ctx, ctx, ctx, ctx, ctx, ctx, username) +Delete a user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **admin_delete_user_public_key** +> admin_delete_user_public_key(ctx, ctx, ctx, ctx, ctx, ctx, username, id) +Delete a user's public key + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + **id** | **i64**| id of the key to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **admin_edit_user** +> ::models::User admin_edit_user(ctx, ctx, ctx, ctx, ctx, ctx, username, optional) +Edit an existing user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of user to edit | + **body** | [**EditUserOption**](EditUserOption.md)| | + +### Return type + +[**::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **admin_get_all_orgs** +> Vec<::models::Organization> admin_get_all_orgs(ctx, ctx, ctx, ctx, ctx, ctx, optional) +List all organizations + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **i32**| page number of results to return (1-based) | + **limit** | **i32**| page size of results, maximum page size is 50 | + +### Return type + +[**Vec<::models::Organization>**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **admin_get_all_users** +> Vec<::models::User> admin_get_all_users(ctx, ctx, ctx, ctx, ctx, ctx, ) +List all users + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/AnnotatedTag.md b/docs/AnnotatedTag.md new file mode 100644 index 0000000..826ef60 --- /dev/null +++ b/docs/AnnotatedTag.md @@ -0,0 +1,16 @@ +# AnnotatedTag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | [optional] [default to null] +**object** | [***::models::AnnotatedTagObject**](AnnotatedTagObject.md) | | [optional] [default to null] +**sha** | **String** | | [optional] [default to null] +**tag** | **String** | | [optional] [default to null] +**tagger** | [***::models::CommitUser**](CommitUser.md) | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] +**verification** | [***::models::PayloadCommitVerification**](PayloadCommitVerification.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnnotatedTagObject.md b/docs/AnnotatedTagObject.md new file mode 100644 index 0000000..f84f3eb --- /dev/null +++ b/docs/AnnotatedTagObject.md @@ -0,0 +1,12 @@ +# AnnotatedTagObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sha** | **String** | | [optional] [default to null] +**_type** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiError.md b/docs/ApiError.md new file mode 100644 index 0000000..f24d94a --- /dev/null +++ b/docs/ApiError.md @@ -0,0 +1,11 @@ +# ApiError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Attachment.md b/docs/Attachment.md new file mode 100644 index 0000000..1086901 --- /dev/null +++ b/docs/Attachment.md @@ -0,0 +1,16 @@ +# Attachment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**browser_download_url** | **String** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**download_count** | **i64** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**size** | **i64** | | [optional] [default to null] +**uuid** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Branch.md b/docs/Branch.md new file mode 100644 index 0000000..54767cd --- /dev/null +++ b/docs/Branch.md @@ -0,0 +1,17 @@ +# Branch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | [***::models::PayloadCommit**](PayloadCommit.md) | | [optional] [default to null] +**enable_status_check** | **bool** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**protected** | **bool** | | [optional] [default to null] +**required_approvals** | **i64** | | [optional] [default to null] +**status_check_contexts** | **Vec** | | [optional] [default to null] +**user_can_merge** | **bool** | | [optional] [default to null] +**user_can_push** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Comment.md b/docs/Comment.md new file mode 100644 index 0000000..5d8d4f8 --- /dev/null +++ b/docs/Comment.md @@ -0,0 +1,19 @@ +# Comment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**html_url** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**issue_url** | **String** | | [optional] [default to null] +**original_author** | **String** | | [optional] [default to null] +**original_author_id** | **i64** | | [optional] [default to null] +**pull_request_url** | **String** | | [optional] [default to null] +**updated_at** | **String** | | [optional] [default to null] +**user** | [***::models::User**](User.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Commit.md b/docs/Commit.md new file mode 100644 index 0000000..d289bb2 --- /dev/null +++ b/docs/Commit.md @@ -0,0 +1,16 @@ +# Commit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | [***::models::User**](User.md) | | [optional] [default to null] +**commit** | [***::models::RepoCommit**](RepoCommit.md) | | [optional] [default to null] +**committer** | [***::models::User**](User.md) | | [optional] [default to null] +**html_url** | **String** | | [optional] [default to null] +**parents** | [**Vec<::models::CommitMeta>**](CommitMeta.md) | | [optional] [default to null] +**sha** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CommitDateOptions.md b/docs/CommitDateOptions.md new file mode 100644 index 0000000..34336dc --- /dev/null +++ b/docs/CommitDateOptions.md @@ -0,0 +1,11 @@ +# CommitDateOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | **String** | | [optional] [default to null] +**committer** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CommitMeta.md b/docs/CommitMeta.md new file mode 100644 index 0000000..6553377 --- /dev/null +++ b/docs/CommitMeta.md @@ -0,0 +1,11 @@ +# CommitMeta + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sha** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CommitUser.md b/docs/CommitUser.md new file mode 100644 index 0000000..bd2568b --- /dev/null +++ b/docs/CommitUser.md @@ -0,0 +1,12 @@ +# CommitUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContentsResponse.md b/docs/ContentsResponse.md new file mode 100644 index 0000000..884c48e --- /dev/null +++ b/docs/ContentsResponse.md @@ -0,0 +1,23 @@ +# ContentsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_links** | [***::models::FileLinksResponse**](FileLinksResponse.md) | | [optional] [default to null] +**content** | **String** | `content` is populated when `type` is `file`, otherwise null | [optional] [default to null] +**download_url** | **String** | | [optional] [default to null] +**encoding** | **String** | `encoding` is populated when `type` is `file`, otherwise null | [optional] [default to null] +**git_url** | **String** | | [optional] [default to null] +**html_url** | **String** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**path** | **String** | | [optional] [default to null] +**sha** | **String** | | [optional] [default to null] +**size** | **i64** | | [optional] [default to null] +**submodule_git_url** | **String** | `submodule_git_url` is populated when `type` is `submodule`, otherwise null | [optional] [default to null] +**target** | **String** | `target` is populated when `type` is `symlink`, otherwise null | [optional] [default to null] +**_type** | **String** | `type` will be `file`, `dir`, `symlink`, or `submodule` | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateEmailOption.md b/docs/CreateEmailOption.md new file mode 100644 index 0000000..d2b8b63 --- /dev/null +++ b/docs/CreateEmailOption.md @@ -0,0 +1,10 @@ +# CreateEmailOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emails** | **Vec** | email addresses to add | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateFileOptions.md b/docs/CreateFileOptions.md new file mode 100644 index 0000000..d37106d --- /dev/null +++ b/docs/CreateFileOptions.md @@ -0,0 +1,16 @@ +# CreateFileOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | [***::models::Identity**](Identity.md) | | [optional] [default to null] +**branch** | **String** | branch (optional) to base this file from. if not given, the default branch is used | [optional] [default to null] +**committer** | [***::models::Identity**](Identity.md) | | [optional] [default to null] +**content** | **String** | content must be base64 encoded | [default to null] +**dates** | [***::models::CommitDateOptions**](CommitDateOptions.md) | | [optional] [default to null] +**message** | **String** | message (optional) for the commit of this file. if not supplied, a default message will be used | [optional] [default to null] +**new_branch** | **String** | new_branch (optional) will make a new branch from `branch` before creating the file | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateForkOption.md b/docs/CreateForkOption.md new file mode 100644 index 0000000..2f4927e --- /dev/null +++ b/docs/CreateForkOption.md @@ -0,0 +1,10 @@ +# CreateForkOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | **String** | organization name, if forking into an organization | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateGpgKeyOption.md b/docs/CreateGpgKeyOption.md new file mode 100644 index 0000000..a1bebc5 --- /dev/null +++ b/docs/CreateGpgKeyOption.md @@ -0,0 +1,10 @@ +# CreateGpgKeyOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**armored_public_key** | **String** | An armored GPG key to add | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateHookOption.md b/docs/CreateHookOption.md new file mode 100644 index 0000000..4c31ecb --- /dev/null +++ b/docs/CreateHookOption.md @@ -0,0 +1,14 @@ +# CreateHookOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | | [optional] [default to null] +**branch_filter** | **String** | | [optional] [default to null] +**config** | [***::models::CreateHookOptionConfig**](CreateHookOptionConfig.md) | | [default to null] +**events** | **Vec** | | [optional] [default to null] +**_type** | **String** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateHookOptionConfig.md b/docs/CreateHookOptionConfig.md new file mode 100644 index 0000000..8b73bf5 --- /dev/null +++ b/docs/CreateHookOptionConfig.md @@ -0,0 +1,9 @@ +# CreateHookOptionConfig + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateIssueCommentOption.md b/docs/CreateIssueCommentOption.md new file mode 100644 index 0000000..6b78522 --- /dev/null +++ b/docs/CreateIssueCommentOption.md @@ -0,0 +1,10 @@ +# CreateIssueCommentOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateIssueOption.md b/docs/CreateIssueOption.md new file mode 100644 index 0000000..e8374cc --- /dev/null +++ b/docs/CreateIssueOption.md @@ -0,0 +1,17 @@ +# CreateIssueOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | **String** | username of assignee | [optional] [default to null] +**assignees** | **Vec** | | [optional] [default to null] +**body** | **String** | | [optional] [default to null] +**closed** | **bool** | | [optional] [default to null] +**due_date** | **String** | | [optional] [default to null] +**labels** | **Vec** | list of label ids | [optional] [default to null] +**milestone** | **i64** | milestone id | [optional] [default to null] +**title** | **String** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateKeyOption.md b/docs/CreateKeyOption.md new file mode 100644 index 0000000..48293c5 --- /dev/null +++ b/docs/CreateKeyOption.md @@ -0,0 +1,12 @@ +# CreateKeyOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **String** | An armored SSH key to add | [default to null] +**read_only** | **bool** | Describe if the key has only read access or read/write | [optional] [default to null] +**title** | **String** | Title of the key to add | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateLabelOption.md b/docs/CreateLabelOption.md new file mode 100644 index 0000000..577aaf3 --- /dev/null +++ b/docs/CreateLabelOption.md @@ -0,0 +1,12 @@ +# CreateLabelOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [default to null] +**description** | **String** | | [optional] [default to null] +**name** | **String** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateMilestoneOption.md b/docs/CreateMilestoneOption.md new file mode 100644 index 0000000..dd99cae --- /dev/null +++ b/docs/CreateMilestoneOption.md @@ -0,0 +1,12 @@ +# CreateMilestoneOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **String** | | [optional] [default to null] +**due_on** | **String** | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateOrgOption.md b/docs/CreateOrgOption.md new file mode 100644 index 0000000..67dfb64 --- /dev/null +++ b/docs/CreateOrgOption.md @@ -0,0 +1,16 @@ +# CreateOrgOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **String** | | [optional] [default to null] +**full_name** | **String** | | [optional] [default to null] +**location** | **String** | | [optional] [default to null] +**repo_admin_change_team_access** | **bool** | | [optional] [default to null] +**username** | **String** | | [default to null] +**visibility** | **String** | possible values are `public` (default), `limited` or `private` | [optional] [default to null] +**website** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreatePullRequestOption.md b/docs/CreatePullRequestOption.md new file mode 100644 index 0000000..df9b2eb --- /dev/null +++ b/docs/CreatePullRequestOption.md @@ -0,0 +1,18 @@ +# CreatePullRequestOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | **String** | | [optional] [default to null] +**assignees** | **Vec** | | [optional] [default to null] +**base** | **String** | | [optional] [default to null] +**body** | **String** | | [optional] [default to null] +**due_date** | **String** | | [optional] [default to null] +**head** | **String** | | [optional] [default to null] +**labels** | **Vec** | | [optional] [default to null] +**milestone** | **i64** | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateReleaseOption.md b/docs/CreateReleaseOption.md new file mode 100644 index 0000000..0708966 --- /dev/null +++ b/docs/CreateReleaseOption.md @@ -0,0 +1,15 @@ +# CreateReleaseOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | [optional] [default to null] +**draft** | **bool** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**prerelease** | **bool** | | [optional] [default to null] +**tag_name** | **String** | | [default to null] +**target_commitish** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateRepoOption.md b/docs/CreateRepoOption.md new file mode 100644 index 0000000..2e1f460 --- /dev/null +++ b/docs/CreateRepoOption.md @@ -0,0 +1,17 @@ +# CreateRepoOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auto_init** | **bool** | Whether the repository should be auto-intialized? | [optional] [default to null] +**description** | **String** | Description of the repository to create | [optional] [default to null] +**gitignores** | **String** | Gitignores to use | [optional] [default to null] +**issue_labels** | **String** | Issue Label set to use | [optional] [default to null] +**license** | **String** | License to use | [optional] [default to null] +**name** | **String** | Name of the repository to create | [default to null] +**private** | **bool** | Whether the repository is private | [optional] [default to null] +**readme** | **String** | Readme of the repository to create | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateStatusOption.md b/docs/CreateStatusOption.md new file mode 100644 index 0000000..4435052 --- /dev/null +++ b/docs/CreateStatusOption.md @@ -0,0 +1,13 @@ +# CreateStatusOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | **String** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**state** | [***::models::StatusState**](StatusState.md) | | [optional] [default to null] +**target_url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateTeamOption.md b/docs/CreateTeamOption.md new file mode 100644 index 0000000..0faa5cc --- /dev/null +++ b/docs/CreateTeamOption.md @@ -0,0 +1,15 @@ +# CreateTeamOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_create_org_repo** | **bool** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**includes_all_repositories** | **bool** | | [optional] [default to null] +**name** | **String** | | [default to null] +**permission** | **String** | | [optional] [default to null] +**units** | **Vec** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateUserOption.md b/docs/CreateUserOption.md new file mode 100644 index 0000000..e20b1f5 --- /dev/null +++ b/docs/CreateUserOption.md @@ -0,0 +1,17 @@ +# CreateUserOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [default to null] +**full_name** | **String** | | [optional] [default to null] +**login_name** | **String** | | [optional] [default to null] +**must_change_password** | **bool** | | [optional] [default to null] +**password** | **String** | | [default to null] +**send_notify** | **bool** | | [optional] [default to null] +**source_id** | **i64** | | [optional] [default to null] +**username** | **String** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeleteEmailOption.md b/docs/DeleteEmailOption.md new file mode 100644 index 0000000..f1e62de --- /dev/null +++ b/docs/DeleteEmailOption.md @@ -0,0 +1,10 @@ +# DeleteEmailOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emails** | **Vec** | email addresses to delete | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeleteFileOptions.md b/docs/DeleteFileOptions.md new file mode 100644 index 0000000..3e9e1a2 --- /dev/null +++ b/docs/DeleteFileOptions.md @@ -0,0 +1,16 @@ +# DeleteFileOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | [***::models::Identity**](Identity.md) | | [optional] [default to null] +**branch** | **String** | branch (optional) to base this file from. if not given, the default branch is used | [optional] [default to null] +**committer** | [***::models::Identity**](Identity.md) | | [optional] [default to null] +**dates** | [***::models::CommitDateOptions**](CommitDateOptions.md) | | [optional] [default to null] +**message** | **String** | message (optional) for the commit of this file. if not supplied, a default message will be used | [optional] [default to null] +**new_branch** | **String** | new_branch (optional) will make a new branch from `branch` before creating the file | [optional] [default to null] +**sha** | **String** | sha is the SHA for the file that already exists | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeployKey.md b/docs/DeployKey.md new file mode 100644 index 0000000..e236e63 --- /dev/null +++ b/docs/DeployKey.md @@ -0,0 +1,18 @@ +# DeployKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | [optional] [default to null] +**fingerprint** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**key** | **String** | | [optional] [default to null] +**key_id** | **i64** | | [optional] [default to null] +**read_only** | **bool** | | [optional] [default to null] +**repository** | [***::models::Repository**](Repository.md) | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditAttachmentOptions.md b/docs/EditAttachmentOptions.md new file mode 100644 index 0000000..0ab6d75 --- /dev/null +++ b/docs/EditAttachmentOptions.md @@ -0,0 +1,10 @@ +# EditAttachmentOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditDeadlineOption.md b/docs/EditDeadlineOption.md new file mode 100644 index 0000000..1f927aa --- /dev/null +++ b/docs/EditDeadlineOption.md @@ -0,0 +1,10 @@ +# EditDeadlineOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **String** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditGitHookOption.md b/docs/EditGitHookOption.md new file mode 100644 index 0000000..b176ef4 --- /dev/null +++ b/docs/EditGitHookOption.md @@ -0,0 +1,10 @@ +# EditGitHookOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditHookOption.md b/docs/EditHookOption.md new file mode 100644 index 0000000..66628fd --- /dev/null +++ b/docs/EditHookOption.md @@ -0,0 +1,13 @@ +# EditHookOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | | [optional] [default to null] +**branch_filter** | **String** | | [optional] [default to null] +**config** | **::std::collections::HashMap** | | [optional] [default to null] +**events** | **Vec** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditIssueCommentOption.md b/docs/EditIssueCommentOption.md new file mode 100644 index 0000000..e281611 --- /dev/null +++ b/docs/EditIssueCommentOption.md @@ -0,0 +1,10 @@ +# EditIssueCommentOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditIssueOption.md b/docs/EditIssueOption.md new file mode 100644 index 0000000..7e9d478 --- /dev/null +++ b/docs/EditIssueOption.md @@ -0,0 +1,17 @@ +# EditIssueOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | **String** | | [optional] [default to null] +**assignees** | **Vec** | | [optional] [default to null] +**body** | **String** | | [optional] [default to null] +**due_date** | **String** | | [optional] [default to null] +**milestone** | **i64** | | [optional] [default to null] +**state** | **String** | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] +**unset_due_date** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditLabelOption.md b/docs/EditLabelOption.md new file mode 100644 index 0000000..991b22d --- /dev/null +++ b/docs/EditLabelOption.md @@ -0,0 +1,12 @@ +# EditLabelOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditMilestoneOption.md b/docs/EditMilestoneOption.md new file mode 100644 index 0000000..20aa425 --- /dev/null +++ b/docs/EditMilestoneOption.md @@ -0,0 +1,13 @@ +# EditMilestoneOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **String** | | [optional] [default to null] +**due_on** | **String** | | [optional] [default to null] +**state** | **String** | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditOrgOption.md b/docs/EditOrgOption.md new file mode 100644 index 0000000..27f1c67 --- /dev/null +++ b/docs/EditOrgOption.md @@ -0,0 +1,15 @@ +# EditOrgOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **String** | | [optional] [default to null] +**full_name** | **String** | | [optional] [default to null] +**location** | **String** | | [optional] [default to null] +**repo_admin_change_team_access** | **bool** | | [optional] [default to null] +**visibility** | **String** | possible values are `public`, `limited` or `private` | [optional] [default to null] +**website** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditPullRequestOption.md b/docs/EditPullRequestOption.md new file mode 100644 index 0000000..dc9a789 --- /dev/null +++ b/docs/EditPullRequestOption.md @@ -0,0 +1,18 @@ +# EditPullRequestOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | **String** | | [optional] [default to null] +**assignees** | **Vec** | | [optional] [default to null] +**body** | **String** | | [optional] [default to null] +**due_date** | **String** | | [optional] [default to null] +**labels** | **Vec** | | [optional] [default to null] +**milestone** | **i64** | | [optional] [default to null] +**state** | **String** | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] +**unset_due_date** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditReactionOption.md b/docs/EditReactionOption.md new file mode 100644 index 0000000..f3ff85b --- /dev/null +++ b/docs/EditReactionOption.md @@ -0,0 +1,10 @@ +# EditReactionOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditReleaseOption.md b/docs/EditReleaseOption.md new file mode 100644 index 0000000..8693e73 --- /dev/null +++ b/docs/EditReleaseOption.md @@ -0,0 +1,15 @@ +# EditReleaseOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | [optional] [default to null] +**draft** | **bool** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**prerelease** | **bool** | | [optional] [default to null] +**tag_name** | **String** | | [optional] [default to null] +**target_commitish** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditRepoOption.md b/docs/EditRepoOption.md new file mode 100644 index 0000000..73c7418 --- /dev/null +++ b/docs/EditRepoOption.md @@ -0,0 +1,27 @@ +# EditRepoOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_merge_commits** | **bool** | either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. `has_pull_requests` must be `true`. | [optional] [default to null] +**allow_rebase** | **bool** | either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. `has_pull_requests` must be `true`. | [optional] [default to null] +**allow_rebase_explicit** | **bool** | either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits. `has_pull_requests` must be `true`. | [optional] [default to null] +**allow_squash_merge** | **bool** | either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. `has_pull_requests` must be `true`. | [optional] [default to null] +**archived** | **bool** | set to `true` to archive this repository. | [optional] [default to null] +**default_branch** | **String** | sets the default branch for this repository. | [optional] [default to null] +**description** | **String** | a short description of the repository. | [optional] [default to null] +**external_tracker** | [***::models::ExternalTracker**](ExternalTracker.md) | | [optional] [default to null] +**external_wiki** | [***::models::ExternalWiki**](ExternalWiki.md) | | [optional] [default to null] +**has_issues** | **bool** | either `true` to enable issues for this repository or `false` to disable them. | [optional] [default to null] +**has_pull_requests** | **bool** | either `true` to allow pull requests, or `false` to prevent pull request. | [optional] [default to null] +**has_wiki** | **bool** | either `true` to enable the wiki for this repository or `false` to disable it. | [optional] [default to null] +**ignore_whitespace_conflicts** | **bool** | either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. `has_pull_requests` must be `true`. | [optional] [default to null] +**internal_tracker** | [***::models::InternalTracker**](InternalTracker.md) | | [optional] [default to null] +**name** | **String** | name of the repository | [optional] [default to null] +**private** | **bool** | either `true` to make the repository private or `false` to make it public. Note: you will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private. | [optional] [default to null] +**template** | **bool** | either `true` to make this repository a template or `false` to make it a normal repository | [optional] [default to null] +**website** | **String** | a URL with more information about the repository. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditTeamOption.md b/docs/EditTeamOption.md new file mode 100644 index 0000000..2808fe7 --- /dev/null +++ b/docs/EditTeamOption.md @@ -0,0 +1,15 @@ +# EditTeamOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_create_org_repo** | **bool** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**includes_all_repositories** | **bool** | | [optional] [default to null] +**name** | **String** | | [default to null] +**permission** | **String** | | [optional] [default to null] +**units** | **Vec** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditUserOption.md b/docs/EditUserOption.md new file mode 100644 index 0000000..7524357 --- /dev/null +++ b/docs/EditUserOption.md @@ -0,0 +1,24 @@ +# EditUserOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | | [optional] [default to null] +**admin** | **bool** | | [optional] [default to null] +**allow_create_organization** | **bool** | | [optional] [default to null] +**allow_git_hook** | **bool** | | [optional] [default to null] +**allow_import_local** | **bool** | | [optional] [default to null] +**email** | **String** | | [default to null] +**full_name** | **String** | | [optional] [default to null] +**location** | **String** | | [optional] [default to null] +**login_name** | **String** | | [optional] [default to null] +**max_repo_creation** | **i64** | | [optional] [default to null] +**must_change_password** | **bool** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**prohibit_login** | **bool** | | [optional] [default to null] +**source_id** | **i64** | | [optional] [default to null] +**website** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Email.md b/docs/Email.md new file mode 100644 index 0000000..0b00a7e --- /dev/null +++ b/docs/Email.md @@ -0,0 +1,12 @@ +# Email + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [optional] [default to null] +**primary** | **bool** | | [optional] [default to null] +**verified** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExternalTracker.md b/docs/ExternalTracker.md new file mode 100644 index 0000000..8e589a3 --- /dev/null +++ b/docs/ExternalTracker.md @@ -0,0 +1,12 @@ +# ExternalTracker + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_tracker_format** | **String** | External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index. | [optional] [default to null] +**external_tracker_style** | **String** | External Issue Tracker Number Format, either `numeric` or `alphanumeric` | [optional] [default to null] +**external_tracker_url** | **String** | URL of external issue tracker. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExternalWiki.md b/docs/ExternalWiki.md new file mode 100644 index 0000000..7124cbe --- /dev/null +++ b/docs/ExternalWiki.md @@ -0,0 +1,10 @@ +# ExternalWiki + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_wiki_url** | **String** | URL of external wiki. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FileCommitResponse.md b/docs/FileCommitResponse.md new file mode 100644 index 0000000..694277f --- /dev/null +++ b/docs/FileCommitResponse.md @@ -0,0 +1,17 @@ +# FileCommitResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | [***::models::CommitUser**](CommitUser.md) | | [optional] [default to null] +**committer** | [***::models::CommitUser**](CommitUser.md) | | [optional] [default to null] +**html_url** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] +**parents** | [**Vec<::models::CommitMeta>**](CommitMeta.md) | | [optional] [default to null] +**sha** | **String** | | [optional] [default to null] +**tree** | [***::models::CommitMeta**](CommitMeta.md) | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FileDeleteResponse.md b/docs/FileDeleteResponse.md new file mode 100644 index 0000000..64f61a0 --- /dev/null +++ b/docs/FileDeleteResponse.md @@ -0,0 +1,12 @@ +# FileDeleteResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | [***::models::FileCommitResponse**](FileCommitResponse.md) | | [optional] [default to null] +**content** | [***Value**](Value.md) | | [optional] [default to null] +**verification** | [***::models::PayloadCommitVerification**](PayloadCommitVerification.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FileLinksResponse.md b/docs/FileLinksResponse.md new file mode 100644 index 0000000..fc5c46c --- /dev/null +++ b/docs/FileLinksResponse.md @@ -0,0 +1,12 @@ +# FileLinksResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**git** | **String** | | [optional] [default to null] +**html** | **String** | | [optional] [default to null] +**_self** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FileResponse.md b/docs/FileResponse.md new file mode 100644 index 0000000..3dd7c5b --- /dev/null +++ b/docs/FileResponse.md @@ -0,0 +1,12 @@ +# FileResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | [***::models::FileCommitResponse**](FileCommitResponse.md) | | [optional] [default to null] +**content** | [***::models::ContentsResponse**](ContentsResponse.md) | | [optional] [default to null] +**verification** | [***::models::PayloadCommitVerification**](PayloadCommitVerification.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GitBlobResponse.md b/docs/GitBlobResponse.md new file mode 100644 index 0000000..23f35a7 --- /dev/null +++ b/docs/GitBlobResponse.md @@ -0,0 +1,14 @@ +# GitBlobResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **String** | | [optional] [default to null] +**encoding** | **String** | | [optional] [default to null] +**sha** | **String** | | [optional] [default to null] +**size** | **i64** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GitEntry.md b/docs/GitEntry.md new file mode 100644 index 0000000..9c33ef7 --- /dev/null +++ b/docs/GitEntry.md @@ -0,0 +1,15 @@ +# GitEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **String** | | [optional] [default to null] +**path** | **String** | | [optional] [default to null] +**sha** | **String** | | [optional] [default to null] +**size** | **i64** | | [optional] [default to null] +**_type** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GitHook.md b/docs/GitHook.md new file mode 100644 index 0000000..19b9aa7 --- /dev/null +++ b/docs/GitHook.md @@ -0,0 +1,12 @@ +# GitHook + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **String** | | [optional] [default to null] +**is_active** | **bool** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GitObject.md b/docs/GitObject.md new file mode 100644 index 0000000..74f0a4c --- /dev/null +++ b/docs/GitObject.md @@ -0,0 +1,12 @@ +# GitObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sha** | **String** | | [optional] [default to null] +**_type** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GitTreeResponse.md b/docs/GitTreeResponse.md new file mode 100644 index 0000000..6821abc --- /dev/null +++ b/docs/GitTreeResponse.md @@ -0,0 +1,15 @@ +# GitTreeResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **i64** | | [optional] [default to null] +**sha** | **String** | | [optional] [default to null] +**total_count** | **i64** | | [optional] [default to null] +**tree** | [**Vec<::models::GitEntry>**](GitEntry.md) | | [optional] [default to null] +**truncated** | **bool** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GpgKey.md b/docs/GpgKey.md new file mode 100644 index 0000000..d313e65 --- /dev/null +++ b/docs/GpgKey.md @@ -0,0 +1,21 @@ +# GpgKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_certify** | **bool** | | [optional] [default to null] +**can_encrypt_comms** | **bool** | | [optional] [default to null] +**can_encrypt_storage** | **bool** | | [optional] [default to null] +**can_sign** | **bool** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**emails** | [**Vec<::models::GpgKeyEmail>**](GPGKeyEmail.md) | | [optional] [default to null] +**expires_at** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**key_id** | **String** | | [optional] [default to null] +**primary_key_id** | **String** | | [optional] [default to null] +**public_key** | **String** | | [optional] [default to null] +**subkeys** | [**Vec<::models::GpgKey>**](GPGKey.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GpgKeyEmail.md b/docs/GpgKeyEmail.md new file mode 100644 index 0000000..3c5583e --- /dev/null +++ b/docs/GpgKeyEmail.md @@ -0,0 +1,11 @@ +# GpgKeyEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [optional] [default to null] +**verified** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Hook.md b/docs/Hook.md new file mode 100644 index 0000000..b125972 --- /dev/null +++ b/docs/Hook.md @@ -0,0 +1,16 @@ +# Hook + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | | [optional] [default to null] +**config** | **::std::collections::HashMap** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**events** | **Vec** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**_type** | **String** | | [optional] [default to null] +**updated_at** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Identity.md b/docs/Identity.md new file mode 100644 index 0000000..6046fc7 --- /dev/null +++ b/docs/Identity.md @@ -0,0 +1,11 @@ +# Identity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineResponse200.md b/docs/InlineResponse200.md new file mode 100644 index 0000000..235c4de --- /dev/null +++ b/docs/InlineResponse200.md @@ -0,0 +1,11 @@ +# InlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec<::models::Team>**](Team.md) | | [optional] [default to null] +**ok** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineResponse2001.md b/docs/InlineResponse2001.md new file mode 100644 index 0000000..6ae5e8d --- /dev/null +++ b/docs/InlineResponse2001.md @@ -0,0 +1,11 @@ +# InlineResponse2001 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec<::models::User>**](User.md) | | [optional] [default to null] +**ok** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InternalTracker.md b/docs/InternalTracker.md new file mode 100644 index 0000000..99836c0 --- /dev/null +++ b/docs/InternalTracker.md @@ -0,0 +1,12 @@ +# InternalTracker + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_only_contributors_to_track_time** | **bool** | Let only contributors track time (Built-in issue tracker) | [optional] [default to null] +**enable_issue_dependencies** | **bool** | Enable dependencies for issues and pull requests (Built-in issue tracker) | [optional] [default to null] +**enable_time_tracker** | **bool** | Enable time tracking (Built-in issue tracker) | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Issue.md b/docs/Issue.md new file mode 100644 index 0000000..ba1d2e6 --- /dev/null +++ b/docs/Issue.md @@ -0,0 +1,30 @@ +# Issue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | [***::models::User**](User.md) | | [optional] [default to null] +**assignees** | [**Vec<::models::User>**](User.md) | | [optional] [default to null] +**body** | **String** | | [optional] [default to null] +**closed_at** | **String** | | [optional] [default to null] +**comments** | **i64** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**due_date** | **String** | | [optional] [default to null] +**html_url** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**labels** | [**Vec<::models::Label>**](Label.md) | | [optional] [default to null] +**milestone** | [***::models::Milestone**](Milestone.md) | | [optional] [default to null] +**number** | **i64** | | [optional] [default to null] +**original_author** | **String** | | [optional] [default to null] +**original_author_id** | **i64** | | [optional] [default to null] +**pull_request** | [***::models::PullRequestMeta**](PullRequestMeta.md) | | [optional] [default to null] +**repository** | [***::models::RepositoryMeta**](RepositoryMeta.md) | | [optional] [default to null] +**state** | [***::models::StateType**](StateType.md) | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] +**updated_at** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] +**user** | [***::models::User**](User.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IssueApi.md b/docs/IssueApi.md new file mode 100644 index 0000000..5b399ca --- /dev/null +++ b/docs/IssueApi.md @@ -0,0 +1,1743 @@ +# \IssueApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**issue_add_label**](IssueApi.md#issue_add_label) | **Post** /repos/{owner}/{repo}/issues/{index}/labels | Add a label to an issue +[**issue_add_subscription**](IssueApi.md#issue_add_subscription) | **Put** /repos/{owner}/{repo}/issues/{index}/subscriptions/{user} | Subscribe user to issue +[**issue_add_time**](IssueApi.md#issue_add_time) | **Post** /repos/{owner}/{repo}/issues/{index}/times | Add tracked time to a issue +[**issue_clear_labels**](IssueApi.md#issue_clear_labels) | **Delete** /repos/{owner}/{repo}/issues/{index}/labels | Remove all labels from an issue +[**issue_create_comment**](IssueApi.md#issue_create_comment) | **Post** /repos/{owner}/{repo}/issues/{index}/comments | Add a comment to an issue +[**issue_create_issue**](IssueApi.md#issue_create_issue) | **Post** /repos/{owner}/{repo}/issues | Create an issue. If using deadline only the date will be taken into account, and time of day ignored. +[**issue_create_label**](IssueApi.md#issue_create_label) | **Post** /repos/{owner}/{repo}/labels | Create a label +[**issue_create_milestone**](IssueApi.md#issue_create_milestone) | **Post** /repos/{owner}/{repo}/milestones | Create a milestone +[**issue_delete_comment**](IssueApi.md#issue_delete_comment) | **Delete** /repos/{owner}/{repo}/issues/comments/{id} | Delete a comment +[**issue_delete_comment_deprecated**](IssueApi.md#issue_delete_comment_deprecated) | **Delete** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Delete a comment +[**issue_delete_comment_reaction**](IssueApi.md#issue_delete_comment_reaction) | **Delete** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Remove a reaction from a comment of an issue +[**issue_delete_issue_reaction**](IssueApi.md#issue_delete_issue_reaction) | **Delete** /repos/{owner}/{repo}/issues/{index}/reactions | Remove a reaction from an issue +[**issue_delete_label**](IssueApi.md#issue_delete_label) | **Delete** /repos/{owner}/{repo}/labels/{id} | Delete a label +[**issue_delete_milestone**](IssueApi.md#issue_delete_milestone) | **Delete** /repos/{owner}/{repo}/milestones/{id} | Delete a milestone +[**issue_delete_stop_watch**](IssueApi.md#issue_delete_stop_watch) | **Delete** /repos/{owner}/{repo}/issues/{index}/stopwatch/delete | Delete an issue's existing stopwatch. +[**issue_delete_subscription**](IssueApi.md#issue_delete_subscription) | **Delete** /repos/{owner}/{repo}/issues/{index}/subscriptions/{user} | Unsubscribe user from issue +[**issue_delete_time**](IssueApi.md#issue_delete_time) | **Delete** /repos/{owner}/{repo}/issues/{index}/times/{id} | Delete specific tracked time +[**issue_edit_comment**](IssueApi.md#issue_edit_comment) | **Patch** /repos/{owner}/{repo}/issues/comments/{id} | Edit a comment +[**issue_edit_comment_deprecated**](IssueApi.md#issue_edit_comment_deprecated) | **Patch** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Edit a comment +[**issue_edit_issue**](IssueApi.md#issue_edit_issue) | **Patch** /repos/{owner}/{repo}/issues/{index} | Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. +[**issue_edit_issue_deadline**](IssueApi.md#issue_edit_issue_deadline) | **Post** /repos/{owner}/{repo}/issues/{index}/deadline | Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. +[**issue_edit_label**](IssueApi.md#issue_edit_label) | **Patch** /repos/{owner}/{repo}/labels/{id} | Update a label +[**issue_edit_milestone**](IssueApi.md#issue_edit_milestone) | **Patch** /repos/{owner}/{repo}/milestones/{id} | Update a milestone +[**issue_get_comment_reactions**](IssueApi.md#issue_get_comment_reactions) | **Get** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Get a list of reactions from a comment of an issue +[**issue_get_comments**](IssueApi.md#issue_get_comments) | **Get** /repos/{owner}/{repo}/issues/{index}/comments | List all comments on an issue +[**issue_get_issue**](IssueApi.md#issue_get_issue) | **Get** /repos/{owner}/{repo}/issues/{index} | Get an issue +[**issue_get_issue_reactions**](IssueApi.md#issue_get_issue_reactions) | **Get** /repos/{owner}/{repo}/issues/{index}/reactions | Get a list reactions of an issue +[**issue_get_label**](IssueApi.md#issue_get_label) | **Get** /repos/{owner}/{repo}/labels/{id} | Get a single label +[**issue_get_labels**](IssueApi.md#issue_get_labels) | **Get** /repos/{owner}/{repo}/issues/{index}/labels | Get an issue's labels +[**issue_get_milestone**](IssueApi.md#issue_get_milestone) | **Get** /repos/{owner}/{repo}/milestones/{id} | Get a milestone +[**issue_get_milestones_list**](IssueApi.md#issue_get_milestones_list) | **Get** /repos/{owner}/{repo}/milestones | Get all of a repository's opened milestones +[**issue_get_repo_comments**](IssueApi.md#issue_get_repo_comments) | **Get** /repos/{owner}/{repo}/issues/comments | List all comments in a repository +[**issue_list_issues**](IssueApi.md#issue_list_issues) | **Get** /repos/{owner}/{repo}/issues | List a repository's issues +[**issue_list_labels**](IssueApi.md#issue_list_labels) | **Get** /repos/{owner}/{repo}/labels | Get all of a repository's labels +[**issue_post_comment_reaction**](IssueApi.md#issue_post_comment_reaction) | **Post** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Add a reaction to a comment of an issue +[**issue_post_issue_reaction**](IssueApi.md#issue_post_issue_reaction) | **Post** /repos/{owner}/{repo}/issues/{index}/reactions | Add a reaction to an issue +[**issue_remove_label**](IssueApi.md#issue_remove_label) | **Delete** /repos/{owner}/{repo}/issues/{index}/labels/{id} | Remove a label from an issue +[**issue_replace_labels**](IssueApi.md#issue_replace_labels) | **Put** /repos/{owner}/{repo}/issues/{index}/labels | Replace an issue's labels +[**issue_reset_time**](IssueApi.md#issue_reset_time) | **Delete** /repos/{owner}/{repo}/issues/{index}/times | Reset a tracked time of an issue +[**issue_search_issues**](IssueApi.md#issue_search_issues) | **Get** /repos/issues/search | Search for issues across the repositories that the user has access to +[**issue_start_stop_watch**](IssueApi.md#issue_start_stop_watch) | **Post** /repos/{owner}/{repo}/issues/{index}/stopwatch/start | Start stopwatch on an issue. +[**issue_stop_stop_watch**](IssueApi.md#issue_stop_stop_watch) | **Post** /repos/{owner}/{repo}/issues/{index}/stopwatch/stop | Stop an issue's existing stopwatch. +[**issue_subscriptions**](IssueApi.md#issue_subscriptions) | **Get** /repos/{owner}/{repo}/issues/{index}/subscriptions | Get users who subscribed on an issue. +[**issue_tracked_times**](IssueApi.md#issue_tracked_times) | **Get** /repos/{owner}/{repo}/issues/{index}/times | List an issue's tracked times + + +# **issue_add_label** +> Vec<::models::Label> issue_add_label(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Add a label to an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **body** | [**IssueLabelsOption**](IssueLabelsOption.md)| | + +### Return type + +[**Vec<::models::Label>**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_add_subscription** +> issue_add_subscription(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, user) +Subscribe user to issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **user** | **String**| user to subscribe | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_add_time** +> ::models::TrackedTime issue_add_time(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Add tracked time to a issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **body** | [**AddTimeOption**](AddTimeOption.md)| | + +### Return type + +[**::models::TrackedTime**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_clear_labels** +> issue_clear_labels(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Remove all labels from an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_create_comment** +> ::models::Comment issue_create_comment(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Add a comment to an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **body** | [**CreateIssueCommentOption**](CreateIssueCommentOption.md)| | + +### Return type + +[**::models::Comment**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_create_issue** +> ::models::Issue issue_create_issue(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Create an issue. If using deadline only the date will be taken into account, and time of day ignored. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**CreateIssueOption**](CreateIssueOption.md)| | + +### Return type + +[**::models::Issue**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_create_label** +> ::models::Label issue_create_label(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Create a label + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**CreateLabelOption**](CreateLabelOption.md)| | + +### Return type + +[**::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_create_milestone** +> ::models::Milestone issue_create_milestone(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Create a milestone + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**CreateMilestoneOption**](CreateMilestoneOption.md)| | + +### Return type + +[**::models::Milestone**](Milestone.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_comment** +> issue_delete_comment(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Delete a comment + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of comment to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_comment_deprecated** +> issue_delete_comment_deprecated(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, id) +Delete a comment + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i32**| this parameter is ignored | + **id** | **i64**| id of comment to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_comment_reaction** +> issue_delete_comment_reaction(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, optional) +Remove a reaction from a comment of an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the comment to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the comment to edit | + **content** | [**EditReactionOption**](EditReactionOption.md)| | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_issue_reaction** +> issue_delete_issue_reaction(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Remove a reaction from an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **content** | [**EditReactionOption**](EditReactionOption.md)| | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_label** +> issue_delete_label(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Delete a label + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the label to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_milestone** +> issue_delete_milestone(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Delete a milestone + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the milestone to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_stop_watch** +> issue_delete_stop_watch(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Delete an issue's existing stopwatch. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to stop the stopwatch on | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_subscription** +> issue_delete_subscription(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, user) +Unsubscribe user from issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **user** | **String**| user witch unsubscribe | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_delete_time** +> issue_delete_time(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, id) +Delete specific tracked time + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **id** | **i64**| id of time to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_edit_comment** +> ::models::Comment issue_edit_comment(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, optional) +Edit a comment + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the comment to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the comment to edit | + **body** | [**EditIssueCommentOption**](EditIssueCommentOption.md)| | + +### Return type + +[**::models::Comment**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_edit_comment_deprecated** +> ::models::Comment issue_edit_comment_deprecated(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, id, optional) +Edit a comment + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i32**| this parameter is ignored | + **id** | **i64**| id of the comment to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i32**| this parameter is ignored | + **id** | **i64**| id of the comment to edit | + **body** | [**EditIssueCommentOption**](EditIssueCommentOption.md)| | + +### Return type + +[**::models::Comment**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_edit_issue** +> ::models::Issue issue_edit_issue(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to edit | + **body** | [**EditIssueOption**](EditIssueOption.md)| | + +### Return type + +[**::models::Issue**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_edit_issue_deadline** +> ::models::IssueDeadline issue_edit_issue_deadline(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to create or update a deadline on | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to create or update a deadline on | + **body** | [**EditDeadlineOption**](EditDeadlineOption.md)| | + +### Return type + +[**::models::IssueDeadline**](IssueDeadline.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_edit_label** +> ::models::Label issue_edit_label(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, optional) +Update a label + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the label to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the label to edit | + **body** | [**EditLabelOption**](EditLabelOption.md)| | + +### Return type + +[**::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_edit_milestone** +> ::models::Milestone issue_edit_milestone(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, optional) +Update a milestone + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the milestone | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the milestone | + **body** | [**EditMilestoneOption**](EditMilestoneOption.md)| | + +### Return type + +[**::models::Milestone**](Milestone.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_comment_reactions** +> Vec<::models::Reaction> issue_get_comment_reactions(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Get a list of reactions from a comment of an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the comment to edit | + +### Return type + +[**Vec<::models::Reaction>**](Reaction.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_comments** +> Vec<::models::Comment> issue_get_comments(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +List all comments on an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **since** | **String**| if provided, only comments updated since the specified time are returned. | + +### Return type + +[**Vec<::models::Comment>**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_issue** +> ::models::Issue issue_get_issue(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Get an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to get | + +### Return type + +[**::models::Issue**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_issue_reactions** +> Vec<::models::Reaction> issue_get_issue_reactions(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Get a list reactions of an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + +### Return type + +[**Vec<::models::Reaction>**](Reaction.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_label** +> ::models::Label issue_get_label(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Get a single label + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the label to get | + +### Return type + +[**::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_labels** +> Vec<::models::Label> issue_get_labels(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Get an issue's labels + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + +### Return type + +[**Vec<::models::Label>**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_milestone** +> ::models::Milestone issue_get_milestone(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Get a milestone + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the milestone | + +### Return type + +[**::models::Milestone**](Milestone.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_milestones_list** +> Vec<::models::Milestone> issue_get_milestones_list(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Get all of a repository's opened milestones + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **state** | **String**| Milestone state, Recognised values are open, closed and all. Defaults to \"open\" | + +### Return type + +[**Vec<::models::Milestone>**](Milestone.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_get_repo_comments** +> Vec<::models::Comment> issue_get_repo_comments(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +List all comments in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **since** | **String**| if provided, only comments updated since the provided time are returned. | + +### Return type + +[**Vec<::models::Comment>**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_list_issues** +> Vec<::models::Issue> issue_list_issues(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +List a repository's issues + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **state** | **String**| whether issue is open or closed | + **labels** | **String**| comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded | + **page** | **i32**| page number of requested issues | + **q** | **String**| search string | + **_type** | **String**| filter by type (issues / pulls) if set | + +### Return type + +[**Vec<::models::Issue>**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_list_labels** +> Vec<::models::Label> issue_list_labels(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Get all of a repository's labels + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::Label>**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_post_comment_reaction** +> ::models::Reaction issue_post_comment_reaction(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, optional) +Add a reaction to a comment of an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the comment to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the comment to edit | + **content** | [**EditReactionOption**](EditReactionOption.md)| | + +### Return type + +[**::models::Reaction**](Reaction.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_post_issue_reaction** +> ::models::Reaction issue_post_issue_reaction(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Add a reaction to an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **content** | [**EditReactionOption**](EditReactionOption.md)| | + +### Return type + +[**::models::Reaction**](Reaction.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_remove_label** +> issue_remove_label(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, id) +Remove a label from an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **id** | **i64**| id of the label to remove | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_replace_labels** +> Vec<::models::Label> issue_replace_labels(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Replace an issue's labels + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + **body** | [**IssueLabelsOption**](IssueLabelsOption.md)| | + +### Return type + +[**Vec<::models::Label>**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_reset_time** +> issue_reset_time(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Reset a tracked time of an issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to add tracked time to | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_search_issues** +> Vec<::models::Issue> issue_search_issues(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Search for issues across the repositories that the user has access to + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **state** | **String**| whether issue is open or closed | + **labels** | **String**| comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded | + **page** | **i32**| page number of requested issues | + **q** | **String**| search string | + **priority_repo_id** | **i64**| repository to prioritize in the results | + **_type** | **String**| filter by type (issues / pulls) if set | + +### Return type + +[**Vec<::models::Issue>**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_start_stop_watch** +> issue_start_stop_watch(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Start stopwatch on an issue. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to create the stopwatch on | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_stop_stop_watch** +> issue_stop_stop_watch(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Stop an issue's existing stopwatch. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue to stop the stopwatch on | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_subscriptions** +> Vec<::models::User> issue_subscriptions(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Get users who subscribed on an issue. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **issue_tracked_times** +> Vec<::models::TrackedTime> issue_tracked_times(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +List an issue's tracked times + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the issue | + +### Return type + +[**Vec<::models::TrackedTime>**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/IssueDeadline.md b/docs/IssueDeadline.md new file mode 100644 index 0000000..a268164 --- /dev/null +++ b/docs/IssueDeadline.md @@ -0,0 +1,10 @@ +# IssueDeadline + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IssueLabelsOption.md b/docs/IssueLabelsOption.md new file mode 100644 index 0000000..28d9efc --- /dev/null +++ b/docs/IssueLabelsOption.md @@ -0,0 +1,10 @@ +# IssueLabelsOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | **Vec** | list of label IDs | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Label.md b/docs/Label.md new file mode 100644 index 0000000..2f6ef13 --- /dev/null +++ b/docs/Label.md @@ -0,0 +1,14 @@ +# Label + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarkdownOption.md b/docs/MarkdownOption.md new file mode 100644 index 0000000..6b81aa5 --- /dev/null +++ b/docs/MarkdownOption.md @@ -0,0 +1,13 @@ +# MarkdownOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | **String** | Context to render in: body | [optional] [default to null] +**mode** | **String** | Mode to render in: body | [optional] [default to null] +**text** | **String** | Text markdown to render in: body | [optional] [default to null] +**wiki** | **bool** | Is it a wiki page ? in: body | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MergePullRequestOption.md b/docs/MergePullRequestOption.md new file mode 100644 index 0000000..d3fdd43 --- /dev/null +++ b/docs/MergePullRequestOption.md @@ -0,0 +1,12 @@ +# MergePullRequestOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_do** | **String** | | [default to null] +**merge_message_field** | **String** | | [optional] [default to null] +**merge_title_field** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MigrateRepoForm.md b/docs/MigrateRepoForm.md new file mode 100644 index 0000000..bffe886 --- /dev/null +++ b/docs/MigrateRepoForm.md @@ -0,0 +1,23 @@ +# MigrateRepoForm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_password** | **String** | | [optional] [default to null] +**auth_username** | **String** | | [optional] [default to null] +**clone_addr** | **String** | | [default to null] +**description** | **String** | | [optional] [default to null] +**issues** | **bool** | | [optional] [default to null] +**labels** | **bool** | | [optional] [default to null] +**milestones** | **bool** | | [optional] [default to null] +**mirror** | **bool** | | [optional] [default to null] +**private** | **bool** | | [optional] [default to null] +**pull_requests** | **bool** | | [optional] [default to null] +**releases** | **bool** | | [optional] [default to null] +**repo_name** | **String** | | [default to null] +**uid** | **i64** | | [default to null] +**wiki** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Milestone.md b/docs/Milestone.md new file mode 100644 index 0000000..e648b74 --- /dev/null +++ b/docs/Milestone.md @@ -0,0 +1,17 @@ +# Milestone + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**closed_at** | **String** | | [optional] [default to null] +**closed_issues** | **i64** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**due_on** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**open_issues** | **i64** | | [optional] [default to null] +**state** | [***::models::StateType**](StateType.md) | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MiscellaneousApi.md b/docs/MiscellaneousApi.md new file mode 100644 index 0000000..6a3b660 --- /dev/null +++ b/docs/MiscellaneousApi.md @@ -0,0 +1,125 @@ +# \MiscellaneousApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_signing_key**](MiscellaneousApi.md#get_signing_key) | **Get** /signing-key.gpg | Get default signing-key.gpg +[**get_version**](MiscellaneousApi.md#get_version) | **Get** /version | Returns the version of the Gitea application +[**render_markdown**](MiscellaneousApi.md#render_markdown) | **Post** /markdown | Render a markdown document as HTML +[**render_markdown_raw**](MiscellaneousApi.md#render_markdown_raw) | **Post** /markdown/raw | Render raw markdown as HTML + + +# **get_signing_key** +> String get_signing_key(ctx, ctx, ctx, ctx, ctx, ctx, ) +Get default signing-key.gpg + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_version** +> ::models::ServerVersion get_version(ctx, ctx, ctx, ctx, ctx, ctx, ) +Returns the version of the Gitea application + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**::models::ServerVersion**](ServerVersion.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **render_markdown** +> String render_markdown(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Render a markdown document as HTML + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**MarkdownOption**](MarkdownOption.md)| | + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **render_markdown_raw** +> String render_markdown_raw(ctx, ctx, ctx, ctx, ctx, ctx, body) +Render raw markdown as HTML + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **body** | **String**| Request body to render | + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: text/plain + - **Accept**: text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Organization.md b/docs/Organization.md new file mode 100644 index 0000000..ec77e28 --- /dev/null +++ b/docs/Organization.md @@ -0,0 +1,18 @@ +# Organization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar_url** | **String** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**full_name** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**location** | **String** | | [optional] [default to null] +**repo_admin_change_team_access** | **bool** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**visibility** | **String** | | [optional] [default to null] +**website** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrganizationApi.md b/docs/OrganizationApi.md new file mode 100644 index 0000000..84bc6d1 --- /dev/null +++ b/docs/OrganizationApi.md @@ -0,0 +1,1123 @@ +# \OrganizationApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_org_repo**](OrganizationApi.md#create_org_repo) | **Post** /org/{org}/repos | Create a repository in an organization +[**org_add_team_member**](OrganizationApi.md#org_add_team_member) | **Put** /teams/{id}/members/{username} | Add a team member +[**org_add_team_repository**](OrganizationApi.md#org_add_team_repository) | **Put** /teams/{id}/repos/{org}/{repo} | Add a repository to a team +[**org_conceal_member**](OrganizationApi.md#org_conceal_member) | **Delete** /orgs/{org}/public_members/{username} | Conceal a user's membership +[**org_create**](OrganizationApi.md#org_create) | **Post** /orgs | Create an organization +[**org_create_hook**](OrganizationApi.md#org_create_hook) | **Post** /orgs/{org}/hooks/ | Create a hook +[**org_create_team**](OrganizationApi.md#org_create_team) | **Post** /orgs/{org}/teams | Create a team +[**org_delete**](OrganizationApi.md#org_delete) | **Delete** /orgs/{org} | Delete an organization +[**org_delete_hook**](OrganizationApi.md#org_delete_hook) | **Delete** /orgs/{org}/hooks/{id} | Delete a hook +[**org_delete_member**](OrganizationApi.md#org_delete_member) | **Delete** /orgs/{org}/members/{username} | Remove a member from an organization +[**org_delete_team**](OrganizationApi.md#org_delete_team) | **Delete** /teams/{id} | Delete a team +[**org_edit**](OrganizationApi.md#org_edit) | **Patch** /orgs/{org} | Edit an organization +[**org_edit_hook**](OrganizationApi.md#org_edit_hook) | **Patch** /orgs/{org}/hooks/{id} | Update a hook +[**org_edit_team**](OrganizationApi.md#org_edit_team) | **Patch** /teams/{id} | Edit a team +[**org_get**](OrganizationApi.md#org_get) | **Get** /orgs/{org} | Get an organization +[**org_get_hook**](OrganizationApi.md#org_get_hook) | **Get** /orgs/{org}/hooks/{id} | Get a hook +[**org_get_team**](OrganizationApi.md#org_get_team) | **Get** /teams/{id} | Get a team +[**org_is_member**](OrganizationApi.md#org_is_member) | **Get** /orgs/{org}/members/{username} | Check if a user is a member of an organization +[**org_is_public_member**](OrganizationApi.md#org_is_public_member) | **Get** /orgs/{org}/public_members/{username} | Check if a user is a public member of an organization +[**org_list_current_user_orgs**](OrganizationApi.md#org_list_current_user_orgs) | **Get** /user/orgs | List the current user's organizations +[**org_list_hooks**](OrganizationApi.md#org_list_hooks) | **Get** /orgs/{org}/hooks | List an organization's webhooks +[**org_list_members**](OrganizationApi.md#org_list_members) | **Get** /orgs/{org}/members | List an organization's members +[**org_list_public_members**](OrganizationApi.md#org_list_public_members) | **Get** /orgs/{org}/public_members | List an organization's public members +[**org_list_repos**](OrganizationApi.md#org_list_repos) | **Get** /orgs/{org}/repos | List an organization's repos +[**org_list_team_member**](OrganizationApi.md#org_list_team_member) | **Get** /teams/{id}/members/{username} | List a particular member of team +[**org_list_team_members**](OrganizationApi.md#org_list_team_members) | **Get** /teams/{id}/members | List a team's members +[**org_list_team_repos**](OrganizationApi.md#org_list_team_repos) | **Get** /teams/{id}/repos | List a team's repos +[**org_list_teams**](OrganizationApi.md#org_list_teams) | **Get** /orgs/{org}/teams | List an organization's teams +[**org_list_user_orgs**](OrganizationApi.md#org_list_user_orgs) | **Get** /users/{username}/orgs | List a user's organizations +[**org_publicize_member**](OrganizationApi.md#org_publicize_member) | **Put** /orgs/{org}/public_members/{username} | Publicize a user's membership +[**org_remove_team_member**](OrganizationApi.md#org_remove_team_member) | **Delete** /teams/{id}/members/{username} | Remove a team member +[**org_remove_team_repository**](OrganizationApi.md#org_remove_team_repository) | **Delete** /teams/{id}/repos/{org}/{repo} | Remove a repository from a team +[**team_search**](OrganizationApi.md#team_search) | **Get** /orgs/{org}/teams/search | Search for teams within an organization + + +# **create_org_repo** +> ::models::Repository create_org_repo(ctx, ctx, ctx, ctx, ctx, ctx, org, optional) +Create a repository in an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of organization | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of organization | + **body** | [**CreateRepoOption**](CreateRepoOption.md)| | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_add_team_member** +> org_add_team_member(ctx, ctx, ctx, ctx, ctx, ctx, id, username) +Add a team member + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team | + **username** | **String**| username of the user to add | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_add_team_repository** +> org_add_team_repository(ctx, ctx, ctx, ctx, ctx, ctx, id, org, repo) +Add a repository to a team + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team | + **org** | **String**| organization that owns the repo to add | + **repo** | **String**| name of the repo to add | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_conceal_member** +> org_conceal_member(ctx, ctx, ctx, ctx, ctx, ctx, org, username) +Conceal a user's membership + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **username** | **String**| username of the user | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_create** +> ::models::Organization org_create(ctx, ctx, ctx, ctx, ctx, ctx, organization) +Create an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **organization** | [**CreateOrgOption**](CreateOrgOption.md)| | + +### Return type + +[**::models::Organization**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_create_hook** +> ::models::Hook org_create_hook(ctx, ctx, ctx, ctx, ctx, ctx, org, body) +Create a hook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **body** | [**CreateHookOption**](CreateHookOption.md)| | + +### Return type + +[**::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_create_team** +> ::models::Team org_create_team(ctx, ctx, ctx, ctx, ctx, ctx, org, optional) +Create a team + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of the organization | + **body** | [**CreateTeamOption**](CreateTeamOption.md)| | + +### Return type + +[**::models::Team**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_delete** +> org_delete(ctx, ctx, ctx, ctx, ctx, ctx, org) +Delete an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| organization that is to be deleted | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_delete_hook** +> org_delete_hook(ctx, ctx, ctx, ctx, ctx, ctx, org, id) +Delete a hook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **id** | **i64**| id of the hook to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_delete_member** +> org_delete_member(ctx, ctx, ctx, ctx, ctx, ctx, org, username) +Remove a member from an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **username** | **String**| username of the user | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_delete_team** +> org_delete_team(ctx, ctx, ctx, ctx, ctx, ctx, id) +Delete a team + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_edit** +> ::models::Organization org_edit(ctx, ctx, ctx, ctx, ctx, ctx, org, body) +Edit an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization to edit | + **body** | [**EditOrgOption**](EditOrgOption.md)| | + +### Return type + +[**::models::Organization**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_edit_hook** +> ::models::Hook org_edit_hook(ctx, ctx, ctx, ctx, ctx, ctx, org, id, optional) +Update a hook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **id** | **i64**| id of the hook to update | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of the organization | + **id** | **i64**| id of the hook to update | + **body** | [**EditHookOption**](EditHookOption.md)| | + +### Return type + +[**::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_edit_team** +> ::models::Team org_edit_team(ctx, ctx, ctx, ctx, ctx, ctx, id, optional) +Edit a team + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i32**| id of the team to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **i32**| id of the team to edit | + **body** | [**EditTeamOption**](EditTeamOption.md)| | + +### Return type + +[**::models::Team**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_get** +> ::models::Organization org_get(ctx, ctx, ctx, ctx, ctx, ctx, org) +Get an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization to get | + +### Return type + +[**::models::Organization**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_get_hook** +> ::models::Hook org_get_hook(ctx, ctx, ctx, ctx, ctx, ctx, org, id) +Get a hook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **id** | **i64**| id of the hook to get | + +### Return type + +[**::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_get_team** +> ::models::Team org_get_team(ctx, ctx, ctx, ctx, ctx, ctx, id) +Get a team + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team to get | + +### Return type + +[**::models::Team**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_is_member** +> org_is_member(ctx, ctx, ctx, ctx, ctx, ctx, org, username) +Check if a user is a member of an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **username** | **String**| username of the user | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_is_public_member** +> org_is_public_member(ctx, ctx, ctx, ctx, ctx, ctx, org, username) +Check if a user is a public member of an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **username** | **String**| username of the user | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_current_user_orgs** +> Vec<::models::Organization> org_list_current_user_orgs(ctx, ctx, ctx, ctx, ctx, ctx, ) +List the current user's organizations + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::Organization>**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_hooks** +> Vec<::models::Hook> org_list_hooks(ctx, ctx, ctx, ctx, ctx, ctx, org) +List an organization's webhooks + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + +### Return type + +[**Vec<::models::Hook>**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_members** +> Vec<::models::User> org_list_members(ctx, ctx, ctx, ctx, ctx, ctx, org) +List an organization's members + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_public_members** +> Vec<::models::User> org_list_public_members(ctx, ctx, ctx, ctx, ctx, ctx, org) +List an organization's public members + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_repos** +> Vec<::models::Repository> org_list_repos(ctx, ctx, ctx, ctx, ctx, ctx, org) +List an organization's repos + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_team_member** +> ::models::User org_list_team_member(ctx, ctx, ctx, ctx, ctx, ctx, id, username) +List a particular member of team + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team | + **username** | **String**| username of the member to list | + +### Return type + +[**::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_team_members** +> Vec<::models::User> org_list_team_members(ctx, ctx, ctx, ctx, ctx, ctx, id) +List a team's members + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_team_repos** +> Vec<::models::Repository> org_list_team_repos(ctx, ctx, ctx, ctx, ctx, ctx, id) +List a team's repos + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team | + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_teams** +> Vec<::models::Team> org_list_teams(ctx, ctx, ctx, ctx, ctx, ctx, org) +List an organization's teams + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + +### Return type + +[**Vec<::models::Team>**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_list_user_orgs** +> Vec<::models::Organization> org_list_user_orgs(ctx, ctx, ctx, ctx, ctx, ctx, username) +List a user's organizations + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + +### Return type + +[**Vec<::models::Organization>**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_publicize_member** +> org_publicize_member(ctx, ctx, ctx, ctx, ctx, ctx, org, username) +Publicize a user's membership + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **username** | **String**| username of the user | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_remove_team_member** +> org_remove_team_member(ctx, ctx, ctx, ctx, ctx, ctx, id, username) +Remove a team member + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team | + **username** | **String**| username of the user to remove | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **org_remove_team_repository** +> org_remove_team_repository(ctx, ctx, ctx, ctx, ctx, ctx, id, org, repo) +Remove a repository from a team + +This does not delete the repository, it only removes the repository from the team. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the team | + **org** | **String**| organization that owns the repo to remove | + **repo** | **String**| name of the repo to remove | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **team_search** +> ::models::InlineResponse200 team_search(ctx, ctx, ctx, ctx, ctx, ctx, org, optional) +Search for teams within an organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **org** | **String**| name of the organization | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of the organization | + **q** | **String**| keywords to search | + **include_desc** | **bool**| include search within team description (defaults to true) | + **limit** | **i32**| limit size of results | + **page** | **i32**| page number of results to return (1-based) | + +### Return type + +[**::models::InlineResponse200**](inline_response_200.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/PayloadCommit.md b/docs/PayloadCommit.md new file mode 100644 index 0000000..580eb8c --- /dev/null +++ b/docs/PayloadCommit.md @@ -0,0 +1,19 @@ +# PayloadCommit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**added** | **Vec** | | [optional] [default to null] +**author** | [***::models::PayloadUser**](PayloadUser.md) | | [optional] [default to null] +**committer** | [***::models::PayloadUser**](PayloadUser.md) | | [optional] [default to null] +**id** | **String** | sha1 hash of the commit | [optional] [default to null] +**message** | **String** | | [optional] [default to null] +**modified** | **Vec** | | [optional] [default to null] +**removed** | **Vec** | | [optional] [default to null] +**timestamp** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] +**verification** | [***::models::PayloadCommitVerification**](PayloadCommitVerification.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PayloadCommitVerification.md b/docs/PayloadCommitVerification.md new file mode 100644 index 0000000..3a5a960 --- /dev/null +++ b/docs/PayloadCommitVerification.md @@ -0,0 +1,14 @@ +# PayloadCommitVerification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payload** | **String** | | [optional] [default to null] +**reason** | **String** | | [optional] [default to null] +**signature** | **String** | | [optional] [default to null] +**signer** | [***::models::PayloadUser**](PayloadUser.md) | | [optional] [default to null] +**verified** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PayloadUser.md b/docs/PayloadUser.md new file mode 100644 index 0000000..20390f9 --- /dev/null +++ b/docs/PayloadUser.md @@ -0,0 +1,12 @@ +# PayloadUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [optional] [default to null] +**name** | **String** | Full name of the commit author | [optional] [default to null] +**username** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Permission.md b/docs/Permission.md new file mode 100644 index 0000000..334fbd6 --- /dev/null +++ b/docs/Permission.md @@ -0,0 +1,12 @@ +# Permission + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin** | **bool** | | [optional] [default to null] +**pull** | **bool** | | [optional] [default to null] +**push** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PrBranchInfo.md b/docs/PrBranchInfo.md new file mode 100644 index 0000000..4ea8be5 --- /dev/null +++ b/docs/PrBranchInfo.md @@ -0,0 +1,14 @@ +# PrBranchInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **String** | | [optional] [default to null] +**_ref** | **String** | | [optional] [default to null] +**repo** | [***::models::Repository**](Repository.md) | | [optional] [default to null] +**repo_id** | **i64** | | [optional] [default to null] +**sha** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PublicKey.md b/docs/PublicKey.md new file mode 100644 index 0000000..c482bf6 --- /dev/null +++ b/docs/PublicKey.md @@ -0,0 +1,18 @@ +# PublicKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | [optional] [default to null] +**fingerprint** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**key** | **String** | | [optional] [default to null] +**key_type** | **String** | | [optional] [default to null] +**read_only** | **bool** | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] +**user** | [***::models::User**](User.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PullRequest.md b/docs/PullRequest.md new file mode 100644 index 0000000..012585c --- /dev/null +++ b/docs/PullRequest.md @@ -0,0 +1,36 @@ +# PullRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | [***::models::User**](User.md) | | [optional] [default to null] +**assignees** | [**Vec<::models::User>**](User.md) | | [optional] [default to null] +**base** | [***::models::PrBranchInfo**](PRBranchInfo.md) | | [optional] [default to null] +**body** | **String** | | [optional] [default to null] +**closed_at** | **String** | | [optional] [default to null] +**comments** | **i64** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**diff_url** | **String** | | [optional] [default to null] +**due_date** | **String** | | [optional] [default to null] +**head** | [***::models::PrBranchInfo**](PRBranchInfo.md) | | [optional] [default to null] +**html_url** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**labels** | [**Vec<::models::Label>**](Label.md) | | [optional] [default to null] +**merge_base** | **String** | | [optional] [default to null] +**merge_commit_sha** | **String** | | [optional] [default to null] +**mergeable** | **bool** | | [optional] [default to null] +**merged** | **bool** | | [optional] [default to null] +**merged_at** | **String** | | [optional] [default to null] +**merged_by** | [***::models::User**](User.md) | | [optional] [default to null] +**milestone** | [***::models::Milestone**](Milestone.md) | | [optional] [default to null] +**number** | **i64** | | [optional] [default to null] +**patch_url** | **String** | | [optional] [default to null] +**state** | [***::models::StateType**](StateType.md) | | [optional] [default to null] +**title** | **String** | | [optional] [default to null] +**updated_at** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] +**user** | [***::models::User**](User.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PullRequestMeta.md b/docs/PullRequestMeta.md new file mode 100644 index 0000000..d58719b --- /dev/null +++ b/docs/PullRequestMeta.md @@ -0,0 +1,11 @@ +# PullRequestMeta + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**merged** | **bool** | | [optional] [default to null] +**merged_at** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Reaction.md b/docs/Reaction.md new file mode 100644 index 0000000..1b020fe --- /dev/null +++ b/docs/Reaction.md @@ -0,0 +1,12 @@ +# Reaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **String** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**user** | [***::models::User**](User.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Reference.md b/docs/Reference.md new file mode 100644 index 0000000..14a52a9 --- /dev/null +++ b/docs/Reference.md @@ -0,0 +1,12 @@ +# Reference + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | [***::models::GitObject**](GitObject.md) | | [optional] [default to null] +**_ref** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Release.md b/docs/Release.md new file mode 100644 index 0000000..3f0113a --- /dev/null +++ b/docs/Release.md @@ -0,0 +1,23 @@ +# Release + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assets** | [**Vec<::models::Attachment>**](Attachment.md) | | [optional] [default to null] +**author** | [***::models::User**](User.md) | | [optional] [default to null] +**body** | **String** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**draft** | **bool** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**prerelease** | **bool** | | [optional] [default to null] +**published_at** | **String** | | [optional] [default to null] +**tag_name** | **String** | | [optional] [default to null] +**tarball_url** | **String** | | [optional] [default to null] +**target_commitish** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] +**zipball_url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepoCommit.md b/docs/RepoCommit.md new file mode 100644 index 0000000..26c97bf --- /dev/null +++ b/docs/RepoCommit.md @@ -0,0 +1,14 @@ +# RepoCommit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | [***::models::CommitUser**](CommitUser.md) | | [optional] [default to null] +**committer** | [***::models::CommitUser**](CommitUser.md) | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] +**tree** | [***::models::CommitMeta**](CommitMeta.md) | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepoTopicOptions.md b/docs/RepoTopicOptions.md new file mode 100644 index 0000000..541efb2 --- /dev/null +++ b/docs/RepoTopicOptions.md @@ -0,0 +1,10 @@ +# RepoTopicOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topics** | **Vec** | list of topic names | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Repository.md b/docs/Repository.md new file mode 100644 index 0000000..428078d --- /dev/null +++ b/docs/Repository.md @@ -0,0 +1,49 @@ +# Repository + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_merge_commits** | **bool** | | [optional] [default to null] +**allow_rebase** | **bool** | | [optional] [default to null] +**allow_rebase_explicit** | **bool** | | [optional] [default to null] +**allow_squash_merge** | **bool** | | [optional] [default to null] +**archived** | **bool** | | [optional] [default to null] +**avatar_url** | **String** | | [optional] [default to null] +**clone_url** | **String** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**default_branch** | **String** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**empty** | **bool** | | [optional] [default to null] +**external_tracker** | [***::models::ExternalTracker**](ExternalTracker.md) | | [optional] [default to null] +**external_wiki** | [***::models::ExternalWiki**](ExternalWiki.md) | | [optional] [default to null] +**fork** | **bool** | | [optional] [default to null] +**forks_count** | **i64** | | [optional] [default to null] +**full_name** | **String** | | [optional] [default to null] +**has_issues** | **bool** | | [optional] [default to null] +**has_pull_requests** | **bool** | | [optional] [default to null] +**has_wiki** | **bool** | | [optional] [default to null] +**html_url** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**ignore_whitespace_conflicts** | **bool** | | [optional] [default to null] +**internal_tracker** | [***::models::InternalTracker**](InternalTracker.md) | | [optional] [default to null] +**mirror** | **bool** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**open_issues_count** | **i64** | | [optional] [default to null] +**open_pr_counter** | **i64** | | [optional] [default to null] +**original_url** | **String** | | [optional] [default to null] +**owner** | [***::models::User**](User.md) | | [optional] [default to null] +**parent** | [***::models::Repository**](Repository.md) | | [optional] [default to null] +**permissions** | [***::models::Permission**](Permission.md) | | [optional] [default to null] +**private** | **bool** | | [optional] [default to null] +**release_counter** | **i64** | | [optional] [default to null] +**size** | **i64** | | [optional] [default to null] +**ssh_url** | **String** | | [optional] [default to null] +**stars_count** | **i64** | | [optional] [default to null] +**template** | **bool** | | [optional] [default to null] +**updated_at** | **String** | | [optional] [default to null] +**watchers_count** | **i64** | | [optional] [default to null] +**website** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md new file mode 100644 index 0000000..a6f7da5 --- /dev/null +++ b/docs/RepositoryApi.md @@ -0,0 +1,2903 @@ +# \RepositoryApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_current_user_repo**](RepositoryApi.md#create_current_user_repo) | **Post** /user/repos | Create a repository +[**create_fork**](RepositoryApi.md#create_fork) | **Post** /repos/{owner}/{repo}/forks | Fork a repository +[**get_blob**](RepositoryApi.md#get_blob) | **Get** /repos/{owner}/{repo}/git/blobs/{sha} | Gets the blob of a repository. +[**get_tag**](RepositoryApi.md#get_tag) | **Get** /repos/{owner}/{repo}/git/tags/{sha} | Gets the tag object of an annotated tag (not lightweight tags) +[**get_tree**](RepositoryApi.md#get_tree) | **Get** /repos/{owner}/{repo}/git/trees/{sha} | Gets the tree of a repository. +[**list_forks**](RepositoryApi.md#list_forks) | **Get** /repos/{owner}/{repo}/forks | List a repository's forks +[**repo_add_collaborator**](RepositoryApi.md#repo_add_collaborator) | **Put** /repos/{owner}/{repo}/collaborators/{collaborator} | Add a collaborator to a repository +[**repo_add_topc**](RepositoryApi.md#repo_add_topc) | **Put** /repos/{owner}/{repo}/topics/{topic} | Add a topic to a repository +[**repo_check_collaborator**](RepositoryApi.md#repo_check_collaborator) | **Get** /repos/{owner}/{repo}/collaborators/{collaborator} | Check if a user is a collaborator of a repository +[**repo_create_file**](RepositoryApi.md#repo_create_file) | **Post** /repos/{owner}/{repo}/contents/{filepath} | Create a file in a repository +[**repo_create_hook**](RepositoryApi.md#repo_create_hook) | **Post** /repos/{owner}/{repo}/hooks | Create a hook +[**repo_create_key**](RepositoryApi.md#repo_create_key) | **Post** /repos/{owner}/{repo}/keys | Add a key to a repository +[**repo_create_pull_request**](RepositoryApi.md#repo_create_pull_request) | **Post** /repos/{owner}/{repo}/pulls | Create a pull request +[**repo_create_release**](RepositoryApi.md#repo_create_release) | **Post** /repos/{owner}/{repo}/releases | Create a release +[**repo_create_release_attachment**](RepositoryApi.md#repo_create_release_attachment) | **Post** /repos/{owner}/{repo}/releases/{id}/assets | Create a release attachment +[**repo_create_status**](RepositoryApi.md#repo_create_status) | **Post** /repos/{owner}/{repo}/statuses/{sha} | Create a commit status +[**repo_delete**](RepositoryApi.md#repo_delete) | **Delete** /repos/{owner}/{repo} | Delete a repository +[**repo_delete_collaborator**](RepositoryApi.md#repo_delete_collaborator) | **Delete** /repos/{owner}/{repo}/collaborators/{collaborator} | Delete a collaborator from a repository +[**repo_delete_file**](RepositoryApi.md#repo_delete_file) | **Delete** /repos/{owner}/{repo}/contents/{filepath} | Delete a file in a repository +[**repo_delete_git_hook**](RepositoryApi.md#repo_delete_git_hook) | **Delete** /repos/{owner}/{repo}/hooks/git/{id} | Delete a Git hook in a repository +[**repo_delete_hook**](RepositoryApi.md#repo_delete_hook) | **Delete** /repos/{owner}/{repo}/hooks/{id} | Delete a hook in a repository +[**repo_delete_key**](RepositoryApi.md#repo_delete_key) | **Delete** /repos/{owner}/{repo}/keys/{id} | Delete a key from a repository +[**repo_delete_release**](RepositoryApi.md#repo_delete_release) | **Delete** /repos/{owner}/{repo}/releases/{id} | Delete a release +[**repo_delete_release_attachment**](RepositoryApi.md#repo_delete_release_attachment) | **Delete** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Delete a release attachment +[**repo_delete_topic**](RepositoryApi.md#repo_delete_topic) | **Delete** /repos/{owner}/{repo}/topics/{topic} | Delete a topic from a repository +[**repo_edit**](RepositoryApi.md#repo_edit) | **Patch** /repos/{owner}/{repo} | Edit a repository's properties. Only fields that are set will be changed. +[**repo_edit_git_hook**](RepositoryApi.md#repo_edit_git_hook) | **Patch** /repos/{owner}/{repo}/hooks/git/{id} | Edit a Git hook in a repository +[**repo_edit_hook**](RepositoryApi.md#repo_edit_hook) | **Patch** /repos/{owner}/{repo}/hooks/{id} | Edit a hook in a repository +[**repo_edit_pull_request**](RepositoryApi.md#repo_edit_pull_request) | **Patch** /repos/{owner}/{repo}/pulls/{index} | Update a pull request. If using deadline only the date will be taken into account, and time of day ignored. +[**repo_edit_release**](RepositoryApi.md#repo_edit_release) | **Patch** /repos/{owner}/{repo}/releases/{id} | Update a release +[**repo_edit_release_attachment**](RepositoryApi.md#repo_edit_release_attachment) | **Patch** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Edit a release attachment +[**repo_get**](RepositoryApi.md#repo_get) | **Get** /repos/{owner}/{repo} | Get a repository +[**repo_get_all_commits**](RepositoryApi.md#repo_get_all_commits) | **Get** /repos/{owner}/{repo}/commits | Get a list of all commits from a repository +[**repo_get_archive**](RepositoryApi.md#repo_get_archive) | **Get** /repos/{owner}/{repo}/archive/{archive} | Get an archive of a repository +[**repo_get_branch**](RepositoryApi.md#repo_get_branch) | **Get** /repos/{owner}/{repo}/branches/{branch} | Retrieve a specific branch from a repository, including its effective branch protection +[**repo_get_by_id**](RepositoryApi.md#repo_get_by_id) | **Get** /repositories/{id} | Get a repository by id +[**repo_get_combined_status_by_ref**](RepositoryApi.md#repo_get_combined_status_by_ref) | **Get** /repos/{owner}/{repo}/commits/{ref}/statuses | Get a commit's combined status, by branch/tag/commit reference +[**repo_get_contents**](RepositoryApi.md#repo_get_contents) | **Get** /repos/{owner}/{repo}/contents/{filepath} | Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir +[**repo_get_contents_list**](RepositoryApi.md#repo_get_contents_list) | **Get** /repos/{owner}/{repo}/contents | Gets the metadata of all the entries of the root dir +[**repo_get_editor_config**](RepositoryApi.md#repo_get_editor_config) | **Get** /repos/{owner}/{repo}/editorconfig/{filepath} | Get the EditorConfig definitions of a file in a repository +[**repo_get_git_hook**](RepositoryApi.md#repo_get_git_hook) | **Get** /repos/{owner}/{repo}/hooks/git/{id} | Get a Git hook +[**repo_get_hook**](RepositoryApi.md#repo_get_hook) | **Get** /repos/{owner}/{repo}/hooks/{id} | Get a hook +[**repo_get_key**](RepositoryApi.md#repo_get_key) | **Get** /repos/{owner}/{repo}/keys/{id} | Get a repository's key by id +[**repo_get_pull_request**](RepositoryApi.md#repo_get_pull_request) | **Get** /repos/{owner}/{repo}/pulls/{index} | Get a pull request +[**repo_get_raw_file**](RepositoryApi.md#repo_get_raw_file) | **Get** /repos/{owner}/{repo}/raw/{filepath} | Get a file from a repository +[**repo_get_release**](RepositoryApi.md#repo_get_release) | **Get** /repos/{owner}/{repo}/releases/{id} | Get a release +[**repo_get_release_attachment**](RepositoryApi.md#repo_get_release_attachment) | **Get** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Get a release attachment +[**repo_get_single_commit**](RepositoryApi.md#repo_get_single_commit) | **Get** /repos/{owner}/{repo}/git/commits/{sha} | Get a single commit from a repository +[**repo_list_all_git_refs**](RepositoryApi.md#repo_list_all_git_refs) | **Get** /repos/{owner}/{repo}/git/refs | Get specified ref or filtered repository's refs +[**repo_list_branches**](RepositoryApi.md#repo_list_branches) | **Get** /repos/{owner}/{repo}/branches | List a repository's branches +[**repo_list_collaborators**](RepositoryApi.md#repo_list_collaborators) | **Get** /repos/{owner}/{repo}/collaborators | List a repository's collaborators +[**repo_list_git_hooks**](RepositoryApi.md#repo_list_git_hooks) | **Get** /repos/{owner}/{repo}/hooks/git | List the Git hooks in a repository +[**repo_list_git_refs**](RepositoryApi.md#repo_list_git_refs) | **Get** /repos/{owner}/{repo}/git/refs/{ref} | Get specified ref or filtered repository's refs +[**repo_list_hooks**](RepositoryApi.md#repo_list_hooks) | **Get** /repos/{owner}/{repo}/hooks | List the hooks in a repository +[**repo_list_keys**](RepositoryApi.md#repo_list_keys) | **Get** /repos/{owner}/{repo}/keys | List a repository's keys +[**repo_list_pull_requests**](RepositoryApi.md#repo_list_pull_requests) | **Get** /repos/{owner}/{repo}/pulls | List a repo's pull requests +[**repo_list_release_attachments**](RepositoryApi.md#repo_list_release_attachments) | **Get** /repos/{owner}/{repo}/releases/{id}/assets | List release's attachments +[**repo_list_releases**](RepositoryApi.md#repo_list_releases) | **Get** /repos/{owner}/{repo}/releases | List a repo's releases +[**repo_list_stargazers**](RepositoryApi.md#repo_list_stargazers) | **Get** /repos/{owner}/{repo}/stargazers | List a repo's stargazers +[**repo_list_statuses**](RepositoryApi.md#repo_list_statuses) | **Get** /repos/{owner}/{repo}/statuses/{sha} | Get a commit's statuses +[**repo_list_subscribers**](RepositoryApi.md#repo_list_subscribers) | **Get** /repos/{owner}/{repo}/subscribers | List a repo's watchers +[**repo_list_tags**](RepositoryApi.md#repo_list_tags) | **Get** /repos/{owner}/{repo}/tags | List a repository's tags +[**repo_list_topics**](RepositoryApi.md#repo_list_topics) | **Get** /repos/{owner}/{repo}/topics | Get list of topics that a repository has +[**repo_merge_pull_request**](RepositoryApi.md#repo_merge_pull_request) | **Post** /repos/{owner}/{repo}/pulls/{index}/merge | Merge a pull request +[**repo_migrate**](RepositoryApi.md#repo_migrate) | **Post** /repos/migrate | Migrate a remote git repository +[**repo_mirror_sync**](RepositoryApi.md#repo_mirror_sync) | **Post** /repos/{owner}/{repo}/mirror-sync | Sync a mirrored repository +[**repo_pull_request_is_merged**](RepositoryApi.md#repo_pull_request_is_merged) | **Get** /repos/{owner}/{repo}/pulls/{index}/merge | Check if a pull request has been merged +[**repo_search**](RepositoryApi.md#repo_search) | **Get** /repos/search | Search for repositories +[**repo_signing_key**](RepositoryApi.md#repo_signing_key) | **Get** /repos/{owner}/{repo}/signing-key.gpg | Get signing-key.gpg for given repository +[**repo_test_hook**](RepositoryApi.md#repo_test_hook) | **Post** /repos/{owner}/{repo}/hooks/{id}/tests | Test a push webhook +[**repo_tracked_times**](RepositoryApi.md#repo_tracked_times) | **Get** /repos/{owner}/{repo}/times | List a repo's tracked times +[**repo_update_file**](RepositoryApi.md#repo_update_file) | **Put** /repos/{owner}/{repo}/contents/{filepath} | Update a file in a repository +[**repo_update_topics**](RepositoryApi.md#repo_update_topics) | **Put** /repos/{owner}/{repo}/topics | Replace list of topics for a repository +[**topic_search**](RepositoryApi.md#topic_search) | **Get** /topics/search | search topics via keyword +[**user_current_check_subscription**](RepositoryApi.md#user_current_check_subscription) | **Get** /repos/{owner}/{repo}/subscription | Check if the current user is watching a repo +[**user_current_delete_subscription**](RepositoryApi.md#user_current_delete_subscription) | **Delete** /repos/{owner}/{repo}/subscription | Unwatch a repo +[**user_current_put_subscription**](RepositoryApi.md#user_current_put_subscription) | **Put** /repos/{owner}/{repo}/subscription | Watch a repo + + +# **create_current_user_repo** +> ::models::Repository create_current_user_repo(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Create a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateRepoOption**](CreateRepoOption.md)| | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_fork** +> ::models::Repository create_fork(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Fork a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo to fork | + **repo** | **String**| name of the repo to fork | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo to fork | + **repo** | **String**| name of the repo to fork | + **body** | [**CreateForkOption**](CreateForkOption.md)| | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_blob** +> ::models::GitBlobResponse get_blob(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, sha) +Gets the blob of a repository. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| sha of the commit | + +### Return type + +[**::models::GitBlobResponse**](GitBlobResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_tag** +> ::models::AnnotatedTag get_tag(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, sha) +Gets the tag object of an annotated tag (not lightweight tags) + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| sha of the tag. The Git tags API only supports annotated tag objects, not lightweight tags. | + +### Return type + +[**::models::AnnotatedTag**](AnnotatedTag.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_tree** +> ::models::GitTreeResponse get_tree(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, sha, optional) +Gets the tree of a repository. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| sha of the commit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| sha of the commit | + **recursive** | **bool**| show all directories and files | + **page** | **i32**| page number; the 'truncated' field in the response will be true if there are still more items after this page, false if the last page | + **per_page** | **i32**| number of items per page; default is 1000 or what is set in app.ini as DEFAULT_GIT_TREES_PER_PAGE | + +### Return type + +[**::models::GitTreeResponse**](GitTreeResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_forks** +> Vec<::models::Repository> list_forks(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List a repository's forks + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_add_collaborator** +> repo_add_collaborator(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, collaborator, optional) +Add a collaborator to a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **collaborator** | **String**| username of the collaborator to add | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **collaborator** | **String**| username of the collaborator to add | + **body** | [**AddCollaboratorOption**](AddCollaboratorOption.md)| | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_add_topc** +> repo_add_topc(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, topic) +Add a topic to a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **topic** | **String**| name of the topic to add | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_check_collaborator** +> repo_check_collaborator(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, collaborator) +Check if a user is a collaborator of a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **collaborator** | **String**| username of the collaborator | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_create_file** +> ::models::FileResponse repo_create_file(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, filepath, body) +Create a file in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **filepath** | **String**| path of the file to create | + **body** | [**CreateFileOptions**](CreateFileOptions.md)| | + +### Return type + +[**::models::FileResponse**](FileResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_create_hook** +> ::models::Hook repo_create_hook(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Create a hook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**CreateHookOption**](CreateHookOption.md)| | + +### Return type + +[**::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_create_key** +> ::models::DeployKey repo_create_key(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Add a key to a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**CreateKeyOption**](CreateKeyOption.md)| | + +### Return type + +[**::models::DeployKey**](DeployKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_create_pull_request** +> ::models::PullRequest repo_create_pull_request(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Create a pull request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**CreatePullRequestOption**](CreatePullRequestOption.md)| | + +### Return type + +[**::models::PullRequest**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_create_release** +> ::models::Release repo_create_release(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Create a release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**CreateReleaseOption**](CreateReleaseOption.md)| | + +### Return type + +[**::models::Release**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_create_release_attachment** +> ::models::Attachment repo_create_release_attachment(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, attachment, optional) +Create a release attachment + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release | + **attachment** | **File**| attachment to upload | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release | + **attachment** | **File**| attachment to upload | + **name** | **String**| name of the attachment | + +### Return type + +[**::models::Attachment**](Attachment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_create_status** +> ::models::Status repo_create_status(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, sha, optional) +Create a commit status + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| sha of the commit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| sha of the commit | + **body** | [**CreateStatusOption**](CreateStatusOption.md)| | + +### Return type + +[**::models::Status**](Status.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete** +> repo_delete(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Delete a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo to delete | + **repo** | **String**| name of the repo to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete_collaborator** +> repo_delete_collaborator(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, collaborator) +Delete a collaborator from a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **collaborator** | **String**| username of the collaborator to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete_file** +> ::models::FileDeleteResponse repo_delete_file(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, filepath, body) +Delete a file in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **filepath** | **String**| path of the file to delete | + **body** | [**DeleteFileOptions**](DeleteFileOptions.md)| | + +### Return type + +[**::models::FileDeleteResponse**](FileDeleteResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete_git_hook** +> repo_delete_git_hook(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Delete a Git hook in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **String**| id of the hook to get | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete_hook** +> repo_delete_hook(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Delete a hook in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the hook to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete_key** +> repo_delete_key(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Delete a key from a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the key to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete_release** +> repo_delete_release(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Delete a release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete_release_attachment** +> repo_delete_release_attachment(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, attachment_id) +Delete a release attachment + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release | + **attachment_id** | **i64**| id of the attachment to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_delete_topic** +> repo_delete_topic(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, topic) +Delete a topic from a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **topic** | **String**| name of the topic to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_edit** +> ::models::Repository repo_edit(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Edit a repository's properties. Only fields that are set will be changed. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo to edit | + **repo** | **String**| name of the repo to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo to edit | + **repo** | **String**| name of the repo to edit | + **body** | [**EditRepoOption**](EditRepoOption.md)| Properties of a repo that you can edit | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_edit_git_hook** +> ::models::GitHook repo_edit_git_hook(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, optional) +Edit a Git hook in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **String**| id of the hook to get | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **String**| id of the hook to get | + **body** | [**EditGitHookOption**](EditGitHookOption.md)| | + +### Return type + +[**::models::GitHook**](GitHook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_edit_hook** +> ::models::Hook repo_edit_hook(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, optional) +Edit a hook in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| index of the hook | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| index of the hook | + **body** | [**EditHookOption**](EditHookOption.md)| | + +### Return type + +[**::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_edit_pull_request** +> ::models::PullRequest repo_edit_pull_request(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Update a pull request. If using deadline only the date will be taken into account, and time of day ignored. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the pull request to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the pull request to edit | + **body** | [**EditPullRequestOption**](EditPullRequestOption.md)| | + +### Return type + +[**::models::PullRequest**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_edit_release** +> ::models::Release repo_edit_release(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, optional) +Update a release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release to edit | + **body** | [**EditReleaseOption**](EditReleaseOption.md)| | + +### Return type + +[**::models::Release**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_edit_release_attachment** +> ::models::Attachment repo_edit_release_attachment(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, attachment_id, optional) +Edit a release attachment + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release | + **attachment_id** | **i64**| id of the attachment to edit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release | + **attachment_id** | **i64**| id of the attachment to edit | + **body** | [**EditAttachmentOptions**](EditAttachmentOptions.md)| | + +### Return type + +[**::models::Attachment**](Attachment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get** +> ::models::Repository repo_get(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Get a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_all_commits** +> Vec<::models::Commit> repo_get_all_commits(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Get a list of all commits from a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| SHA or branch to start listing commits from (usually 'master') | + **page** | **i32**| page number of requested commits | + +### Return type + +[**Vec<::models::Commit>**](Commit.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_archive** +> repo_get_archive(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, archive) +Get an archive of a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **archive** | **String**| archive to download, consisting of a git reference and archive | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_branch** +> ::models::Branch repo_get_branch(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, branch) +Retrieve a specific branch from a repository, including its effective branch protection + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **branch** | **String**| branch to get | + +### Return type + +[**::models::Branch**](Branch.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_by_id** +> ::models::Repository repo_get_by_id(ctx, ctx, ctx, ctx, ctx, ctx, id) +Get a repository by id + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of the repo to get | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_combined_status_by_ref** +> ::models::Status repo_get_combined_status_by_ref(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, _ref, optional) +Get a commit's combined status, by branch/tag/commit reference + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **_ref** | **String**| name of branch/tag/commit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **_ref** | **String**| name of branch/tag/commit | + **page** | **i32**| page number of results | + +### Return type + +[**::models::Status**](Status.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_contents** +> ::models::ContentsResponse repo_get_contents(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, filepath, optional) +Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **filepath** | **String**| path of the dir, file, symlink or submodule in the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **filepath** | **String**| path of the dir, file, symlink or submodule in the repo | + **_ref** | **String**| The name of the commit/branch/tag. Default the repository’s default branch (usually master) | + +### Return type + +[**::models::ContentsResponse**](ContentsResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_contents_list** +> Vec<::models::ContentsResponse> repo_get_contents_list(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Gets the metadata of all the entries of the root dir + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **_ref** | **String**| The name of the commit/branch/tag. Default the repository’s default branch (usually master) | + +### Return type + +[**Vec<::models::ContentsResponse>**](ContentsResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_editor_config** +> repo_get_editor_config(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, filepath) +Get the EditorConfig definitions of a file in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **filepath** | **String**| filepath of file to get | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_git_hook** +> ::models::GitHook repo_get_git_hook(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Get a Git hook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **String**| id of the hook to get | + +### Return type + +[**::models::GitHook**](GitHook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_hook** +> ::models::Hook repo_get_hook(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Get a hook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the hook to get | + +### Return type + +[**::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_key** +> ::models::DeployKey repo_get_key(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Get a repository's key by id + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the key to get | + +### Return type + +[**::models::DeployKey**](DeployKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_pull_request** +> ::models::PullRequest repo_get_pull_request(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Get a pull request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the pull request to get | + +### Return type + +[**::models::PullRequest**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_raw_file** +> repo_get_raw_file(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, filepath) +Get a file from a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **filepath** | **String**| filepath of the file to get | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_release** +> ::models::Release repo_get_release(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Get a release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release to get | + +### Return type + +[**::models::Release**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_release_attachment** +> ::models::Attachment repo_get_release_attachment(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id, attachment_id) +Get a release attachment + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release | + **attachment_id** | **i64**| id of the attachment to get | + +### Return type + +[**::models::Attachment**](Attachment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_get_single_commit** +> ::models::Commit repo_get_single_commit(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, sha) +Get a single commit from a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| the commit hash | + +### Return type + +[**::models::Commit**](Commit.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_all_git_refs** +> Vec<::models::Reference> repo_list_all_git_refs(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Get specified ref or filtered repository's refs + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::Reference>**](Reference.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_branches** +> Vec<::models::Branch> repo_list_branches(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List a repository's branches + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::Branch>**](Branch.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_collaborators** +> Vec<::models::User> repo_list_collaborators(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List a repository's collaborators + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_git_hooks** +> Vec<::models::GitHook> repo_list_git_hooks(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List the Git hooks in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::GitHook>**](GitHook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_git_refs** +> Vec<::models::Reference> repo_list_git_refs(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, _ref) +Get specified ref or filtered repository's refs + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **_ref** | **String**| part or full name of the ref | + +### Return type + +[**Vec<::models::Reference>**](Reference.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_hooks** +> Vec<::models::Hook> repo_list_hooks(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List the hooks in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::Hook>**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_keys** +> Vec<::models::DeployKey> repo_list_keys(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +List a repository's keys + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **key_id** | **i32**| the key_id to search for | + **fingerprint** | **String**| fingerprint of the key | + +### Return type + +[**Vec<::models::DeployKey>**](DeployKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_pull_requests** +> Vec<::models::PullRequest> repo_list_pull_requests(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +List a repo's pull requests + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **page** | **i32**| Page number | + **state** | **String**| State of pull request: open or closed (optional) | + **sort** | **String**| Type of sort | + **milestone** | **i64**| ID of the milestone | + **labels** | [**Vec<i64>**](i64.md)| Label IDs | + +### Return type + +[**Vec<::models::PullRequest>**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_release_attachments** +> Vec<::models::Attachment> repo_list_release_attachments(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +List release's attachments + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the release | + +### Return type + +[**Vec<::models::Attachment>**](Attachment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_releases** +> Vec<::models::Release> repo_list_releases(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +List a repo's releases + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **page** | **i32**| page wants to load | + **per_page** | **i32**| items count every page wants to load | + +### Return type + +[**Vec<::models::Release>**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_stargazers** +> Vec<::models::User> repo_list_stargazers(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List a repo's stargazers + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_statuses** +> Vec<::models::Status> repo_list_statuses(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, sha, optional) +Get a commit's statuses + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| sha of the commit | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **sha** | **String**| sha of the commit | + **page** | **i32**| page number of results | + **sort** | **String**| type of sort | + **state** | **String**| type of state | + +### Return type + +[**Vec<::models::Status>**](Status.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_subscribers** +> Vec<::models::User> repo_list_subscribers(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List a repo's watchers + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_tags** +> Vec<::models::Tag> repo_list_tags(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List a repository's tags + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::Tag>**](Tag.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_list_topics** +> ::models::TopicName repo_list_topics(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Get list of topics that a repository has + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**::models::TopicName**](TopicName.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_merge_pull_request** +> repo_merge_pull_request(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index, optional) +Merge a pull request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the pull request to merge | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the pull request to merge | + **body** | [**MergePullRequestOption**](MergePullRequestOption.md)| | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_migrate** +> ::models::Repository repo_migrate(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Migrate a remote git repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**MigrateRepoForm**](MigrateRepoForm.md)| | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_mirror_sync** +> repo_mirror_sync(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Sync a mirrored repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo to sync | + **repo** | **String**| name of the repo to sync | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_pull_request_is_merged** +> repo_pull_request_is_merged(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, index) +Check if a pull request has been merged + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **i64**| index of the pull request | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_search** +> ::models::SearchResults repo_search(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Search for repositories + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **q** | **String**| keyword | + **topic** | **bool**| Limit search to repositories with keyword as topic | + **include_desc** | **bool**| include search of keyword within repository description | + **uid** | **i64**| search only for repos that the user with the given id owns or contributes to | + **priority_owner_id** | **i64**| repo owner to prioritize in the results | + **starred_by** | **i64**| search only for repos that the user with the given id has starred | + **private** | **bool**| include private repositories this user has access to (defaults to true) | + **template** | **bool**| include template repositories this user has access to (defaults to true) | + **page** | **i32**| page number of results to return (1-based) | + **limit** | **i32**| page size of results, maximum page size is 50 | + **mode** | **String**| type of repository to search for. Supported values are \"fork\", \"source\", \"mirror\" and \"collaborative\" | + **exclusive** | **bool**| if `uid` is given, search only for repos that the user owns | + **sort** | **String**| sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", and \"id\". Default is \"alpha\" | + **order** | **String**| sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified. | + +### Return type + +[**::models::SearchResults**](SearchResults.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_signing_key** +> String repo_signing_key(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Get signing-key.gpg for given repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_test_hook** +> repo_test_hook(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, id) +Test a push webhook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **id** | **i64**| id of the hook to test | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_tracked_times** +> Vec<::models::TrackedTime> repo_tracked_times(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +List a repo's tracked times + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Vec<::models::TrackedTime>**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_update_file** +> ::models::FileResponse repo_update_file(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, filepath, body) +Update a file in a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **filepath** | **String**| path of the file to update | + **body** | [**UpdateFileOptions**](UpdateFileOptions.md)| | + +### Return type + +[**::models::FileResponse**](FileResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repo_update_topics** +> repo_update_topics(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, optional) +Replace list of topics for a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**RepoTopicOptions**](RepoTopicOptions.md)| | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **topic_search** +> Vec<::models::TopicResponse> topic_search(ctx, ctx, ctx, ctx, ctx, ctx, q) +search topics via keyword + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **q** | **String**| keywords to search | + +### Return type + +[**Vec<::models::TopicResponse>**](TopicResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_check_subscription** +> ::models::WatchInfo user_current_check_subscription(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Check if the current user is watching a repo + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**::models::WatchInfo**](WatchInfo.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_delete_subscription** +> user_current_delete_subscription(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Unwatch a repo + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_put_subscription** +> ::models::WatchInfo user_current_put_subscription(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Watch a repo + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**::models::WatchInfo**](WatchInfo.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/RepositoryMeta.md b/docs/RepositoryMeta.md new file mode 100644 index 0000000..3d0fb57 --- /dev/null +++ b/docs/RepositoryMeta.md @@ -0,0 +1,12 @@ +# RepositoryMeta + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**full_name** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SearchResults.md b/docs/SearchResults.md new file mode 100644 index 0000000..1247306 --- /dev/null +++ b/docs/SearchResults.md @@ -0,0 +1,11 @@ +# SearchResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec<::models::Repository>**](Repository.md) | | [optional] [default to null] +**ok** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ServerVersion.md b/docs/ServerVersion.md new file mode 100644 index 0000000..cfd238b --- /dev/null +++ b/docs/ServerVersion.md @@ -0,0 +1,10 @@ +# ServerVersion + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StateType.md b/docs/StateType.md new file mode 100644 index 0000000..4ba45d2 --- /dev/null +++ b/docs/StateType.md @@ -0,0 +1,9 @@ +# StateType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Status.md b/docs/Status.md new file mode 100644 index 0000000..da42aad --- /dev/null +++ b/docs/Status.md @@ -0,0 +1,18 @@ +# Status + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | **String** | | [optional] [default to null] +**created_at** | **String** | | [optional] [default to null] +**creator** | [***::models::User**](User.md) | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**status** | [***::models::StatusState**](StatusState.md) | | [optional] [default to null] +**target_url** | **String** | | [optional] [default to null] +**updated_at** | **String** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StatusState.md b/docs/StatusState.md new file mode 100644 index 0000000..c676f43 --- /dev/null +++ b/docs/StatusState.md @@ -0,0 +1,9 @@ +# StatusState + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StopWatch.md b/docs/StopWatch.md new file mode 100644 index 0000000..b84acf5 --- /dev/null +++ b/docs/StopWatch.md @@ -0,0 +1,11 @@ +# StopWatch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | **String** | | [optional] [default to null] +**issue_index** | **i64** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Tag.md b/docs/Tag.md new file mode 100644 index 0000000..3d061ee --- /dev/null +++ b/docs/Tag.md @@ -0,0 +1,14 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | [***::models::CommitMeta**](CommitMeta.md) | | [optional] [default to null] +**id** | **String** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**tarball_url** | **String** | | [optional] [default to null] +**zipball_url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Team.md b/docs/Team.md new file mode 100644 index 0000000..54a122e --- /dev/null +++ b/docs/Team.md @@ -0,0 +1,17 @@ +# Team + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_create_org_repo** | **bool** | | [optional] [default to null] +**description** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**includes_all_repositories** | **bool** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] +**organization** | [***::models::Organization**](Organization.md) | | [optional] [default to null] +**permission** | **String** | | [optional] [default to null] +**units** | **Vec** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TimeStamp.md b/docs/TimeStamp.md new file mode 100644 index 0000000..77f4b28 --- /dev/null +++ b/docs/TimeStamp.md @@ -0,0 +1,9 @@ +# TimeStamp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TopicName.md b/docs/TopicName.md new file mode 100644 index 0000000..d85bec2 --- /dev/null +++ b/docs/TopicName.md @@ -0,0 +1,10 @@ +# TopicName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topics** | **Vec** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TopicResponse.md b/docs/TopicResponse.md new file mode 100644 index 0000000..e97bc48 --- /dev/null +++ b/docs/TopicResponse.md @@ -0,0 +1,14 @@ +# TopicResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**repo_count** | **i64** | | [optional] [default to null] +**topic_name** | **String** | | [optional] [default to null] +**updated** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TrackedTime.md b/docs/TrackedTime.md new file mode 100644 index 0000000..c4844b6 --- /dev/null +++ b/docs/TrackedTime.md @@ -0,0 +1,16 @@ +# TrackedTime + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | **String** | | [optional] [default to null] +**id** | **i64** | | [optional] [default to null] +**issue** | [***::models::Issue**](Issue.md) | | [optional] [default to null] +**issue_id** | **i64** | deprecated (only for backwards compatibility) | [optional] [default to null] +**time** | **i64** | Time in seconds | [optional] [default to null] +**user_id** | **i64** | deprecated (only for backwards compatibility) | [optional] [default to null] +**user_name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateFileOptions.md b/docs/UpdateFileOptions.md new file mode 100644 index 0000000..aedf64a --- /dev/null +++ b/docs/UpdateFileOptions.md @@ -0,0 +1,18 @@ +# UpdateFileOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | [***::models::Identity**](Identity.md) | | [optional] [default to null] +**branch** | **String** | branch (optional) to base this file from. if not given, the default branch is used | [optional] [default to null] +**committer** | [***::models::Identity**](Identity.md) | | [optional] [default to null] +**content** | **String** | content must be base64 encoded | [default to null] +**dates** | [***::models::CommitDateOptions**](CommitDateOptions.md) | | [optional] [default to null] +**from_path** | **String** | from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL | [optional] [default to null] +**message** | **String** | message (optional) for the commit of this file. if not supplied, a default message will be used | [optional] [default to null] +**new_branch** | **String** | new_branch (optional) will make a new branch from `branch` before creating the file | [optional] [default to null] +**sha** | **String** | sha is the SHA for the file that already exists | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/User.md b/docs/User.md new file mode 100644 index 0000000..34582fe --- /dev/null +++ b/docs/User.md @@ -0,0 +1,18 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar_url** | **String** | URL to the user's avatar | [optional] [default to null] +**created** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**full_name** | **String** | the user's full name | [optional] [default to null] +**id** | **i64** | the user's id | [optional] [default to null] +**is_admin** | **bool** | Is the user an administrator | [optional] [default to null] +**language** | **String** | User locale | [optional] [default to null] +**last_login** | **String** | | [optional] [default to null] +**login** | **String** | the user's username | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserApi.md b/docs/UserApi.md new file mode 100644 index 0000000..9682aba --- /dev/null +++ b/docs/UserApi.md @@ -0,0 +1,1329 @@ +# \UserApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_current_user_repo**](UserApi.md#create_current_user_repo) | **Post** /user/repos | Create a repository +[**user_add_email**](UserApi.md#user_add_email) | **Post** /user/emails | Add email addresses +[**user_check_following**](UserApi.md#user_check_following) | **Get** /users/{follower}/following/{followee} | Check if one user is following another user +[**user_create_token**](UserApi.md#user_create_token) | **Post** /users/{username}/tokens | Create an access token +[**user_current_check_following**](UserApi.md#user_current_check_following) | **Get** /user/following/{username} | Check whether a user is followed by the authenticated user +[**user_current_check_starring**](UserApi.md#user_current_check_starring) | **Get** /user/starred/{owner}/{repo} | Whether the authenticated is starring the repo +[**user_current_delete_follow**](UserApi.md#user_current_delete_follow) | **Delete** /user/following/{username} | Unfollow a user +[**user_current_delete_gpg_key**](UserApi.md#user_current_delete_gpg_key) | **Delete** /user/gpg_keys/{id} | Remove a GPG key +[**user_current_delete_key**](UserApi.md#user_current_delete_key) | **Delete** /user/keys/{id} | Delete a public key +[**user_current_delete_star**](UserApi.md#user_current_delete_star) | **Delete** /user/starred/{owner}/{repo} | Unstar the given repo +[**user_current_get_gpg_key**](UserApi.md#user_current_get_gpg_key) | **Get** /user/gpg_keys/{id} | Get a GPG key +[**user_current_get_key**](UserApi.md#user_current_get_key) | **Get** /user/keys/{id} | Get a public key +[**user_current_list_followers**](UserApi.md#user_current_list_followers) | **Get** /user/followers | List the authenticated user's followers +[**user_current_list_following**](UserApi.md#user_current_list_following) | **Get** /user/following | List the users that the authenticated user is following +[**user_current_list_gpg_keys**](UserApi.md#user_current_list_gpg_keys) | **Get** /user/gpg_keys | List the authenticated user's GPG keys +[**user_current_list_keys**](UserApi.md#user_current_list_keys) | **Get** /user/keys | List the authenticated user's public keys +[**user_current_list_repos**](UserApi.md#user_current_list_repos) | **Get** /user/repos | List the repos that the authenticated user owns or has access to +[**user_current_list_starred**](UserApi.md#user_current_list_starred) | **Get** /user/starred | The repos that the authenticated user has starred +[**user_current_list_subscriptions**](UserApi.md#user_current_list_subscriptions) | **Get** /user/subscriptions | List repositories watched by the authenticated user +[**user_current_post_gpg_key**](UserApi.md#user_current_post_gpg_key) | **Post** /user/gpg_keys | Create a GPG key +[**user_current_post_key**](UserApi.md#user_current_post_key) | **Post** /user/keys | Create a public key +[**user_current_put_follow**](UserApi.md#user_current_put_follow) | **Put** /user/following/{username} | Follow a user +[**user_current_put_star**](UserApi.md#user_current_put_star) | **Put** /user/starred/{owner}/{repo} | Star the given repo +[**user_current_tracked_times**](UserApi.md#user_current_tracked_times) | **Get** /user/times | List the current user's tracked times +[**user_delete_access_token**](UserApi.md#user_delete_access_token) | **Delete** /users/{username}/tokens/{token} | delete an access token +[**user_delete_email**](UserApi.md#user_delete_email) | **Delete** /user/emails | Delete email addresses +[**user_get**](UserApi.md#user_get) | **Get** /users/{username} | Get a user +[**user_get_current**](UserApi.md#user_get_current) | **Get** /user | Get the authenticated user +[**user_get_heatmap_data**](UserApi.md#user_get_heatmap_data) | **Get** /users/{username}/heatmap | Get a user's heatmap +[**user_get_stop_watches**](UserApi.md#user_get_stop_watches) | **Get** /user/stopwatches | Get list of all existing stopwatches +[**user_get_tokens**](UserApi.md#user_get_tokens) | **Get** /users/{username}/tokens | List the authenticated user's access tokens +[**user_list_emails**](UserApi.md#user_list_emails) | **Get** /user/emails | List the authenticated user's email addresses +[**user_list_followers**](UserApi.md#user_list_followers) | **Get** /users/{username}/followers | List the given user's followers +[**user_list_following**](UserApi.md#user_list_following) | **Get** /users/{username}/following | List the users that the given user is following +[**user_list_gpg_keys**](UserApi.md#user_list_gpg_keys) | **Get** /users/{username}/gpg_keys | List the given user's GPG keys +[**user_list_keys**](UserApi.md#user_list_keys) | **Get** /users/{username}/keys | List the given user's public keys +[**user_list_repos**](UserApi.md#user_list_repos) | **Get** /users/{username}/repos | List the repos owned by the given user +[**user_list_starred**](UserApi.md#user_list_starred) | **Get** /users/{username}/starred | The repos that the given user has starred +[**user_list_subscriptions**](UserApi.md#user_list_subscriptions) | **Get** /users/{username}/subscriptions | List the repositories watched by a user +[**user_list_teams**](UserApi.md#user_list_teams) | **Get** /user/teams | List all the teams a user belongs to +[**user_search**](UserApi.md#user_search) | **Get** /users/search | Search for users +[**user_tracked_times**](UserApi.md#user_tracked_times) | **Get** /repos/{owner}/{repo}/times/{user} | List a user's tracked times in a repo + + +# **create_current_user_repo** +> ::models::Repository create_current_user_repo(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Create a repository + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateRepoOption**](CreateRepoOption.md)| | + +### Return type + +[**::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_add_email** +> Vec<::models::Email> user_add_email(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Add email addresses + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateEmailOption**](CreateEmailOption.md)| | + +### Return type + +[**Vec<::models::Email>**](Email.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_check_following** +> user_check_following(ctx, ctx, ctx, ctx, ctx, ctx, follower, followee) +Check if one user is following another user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **follower** | **String**| username of following user | + **followee** | **String**| username of followed user | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_create_token** +> user_create_token(ctx, ctx, ctx, ctx, ctx, ctx, username, optional) +Create an access token + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of user | + **access_token** | [**AccessToken**](AccessToken.md)| | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_check_following** +> user_current_check_following(ctx, ctx, ctx, ctx, ctx, ctx, username) +Check whether a user is followed by the authenticated user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of followed user | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_check_starring** +> user_current_check_starring(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Whether the authenticated is starring the repo + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_delete_follow** +> user_current_delete_follow(ctx, ctx, ctx, ctx, ctx, ctx, username) +Unfollow a user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user to unfollow | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_delete_gpg_key** +> user_current_delete_gpg_key(ctx, ctx, ctx, ctx, ctx, ctx, id) +Remove a GPG key + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of key to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_delete_key** +> user_current_delete_key(ctx, ctx, ctx, ctx, ctx, ctx, id) +Delete a public key + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of key to delete | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_delete_star** +> user_current_delete_star(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Unstar the given repo + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo to unstar | + **repo** | **String**| name of the repo to unstar | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_get_gpg_key** +> ::models::GpgKey user_current_get_gpg_key(ctx, ctx, ctx, ctx, ctx, ctx, id) +Get a GPG key + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of key to get | + +### Return type + +[**::models::GpgKey**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_get_key** +> ::models::PublicKey user_current_get_key(ctx, ctx, ctx, ctx, ctx, ctx, id) +Get a public key + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **id** | **i64**| id of key to get | + +### Return type + +[**::models::PublicKey**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_list_followers** +> Vec<::models::User> user_current_list_followers(ctx, ctx, ctx, ctx, ctx, ctx, ) +List the authenticated user's followers + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_list_following** +> Vec<::models::User> user_current_list_following(ctx, ctx, ctx, ctx, ctx, ctx, ) +List the users that the authenticated user is following + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_list_gpg_keys** +> Vec<::models::GpgKey> user_current_list_gpg_keys(ctx, ctx, ctx, ctx, ctx, ctx, ) +List the authenticated user's GPG keys + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::GpgKey>**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_list_keys** +> Vec<::models::PublicKey> user_current_list_keys(ctx, ctx, ctx, ctx, ctx, ctx, optional) +List the authenticated user's public keys + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fingerprint** | **String**| fingerprint of the key | + +### Return type + +[**Vec<::models::PublicKey>**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_list_repos** +> Vec<::models::Repository> user_current_list_repos(ctx, ctx, ctx, ctx, ctx, ctx, ) +List the repos that the authenticated user owns or has access to + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_list_starred** +> Vec<::models::Repository> user_current_list_starred(ctx, ctx, ctx, ctx, ctx, ctx, ) +The repos that the authenticated user has starred + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_list_subscriptions** +> Vec<::models::Repository> user_current_list_subscriptions(ctx, ctx, ctx, ctx, ctx, ctx, ) +List repositories watched by the authenticated user + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_post_gpg_key** +> ::models::GpgKey user_current_post_gpg_key(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Create a GPG key + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **form** | [**CreateGpgKeyOption**](CreateGpgKeyOption.md)| | + +### Return type + +[**::models::GpgKey**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_post_key** +> ::models::PublicKey user_current_post_key(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Create a public key + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateKeyOption**](CreateKeyOption.md)| | + +### Return type + +[**::models::PublicKey**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_put_follow** +> user_current_put_follow(ctx, ctx, ctx, ctx, ctx, ctx, username) +Follow a user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user to follow | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_put_star** +> user_current_put_star(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo) +Star the given repo + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo to star | + **repo** | **String**| name of the repo to star | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_current_tracked_times** +> Vec<::models::TrackedTime> user_current_tracked_times(ctx, ctx, ctx, ctx, ctx, ctx, ) +List the current user's tracked times + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::TrackedTime>**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_delete_access_token** +> user_delete_access_token(ctx, ctx, ctx, ctx, ctx, ctx, username, token) +delete an access token + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + **token** | **i64**| token to be deleted | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_delete_email** +> user_delete_email(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Delete email addresses + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DeleteEmailOption**](DeleteEmailOption.md)| | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_get** +> ::models::User user_get(ctx, ctx, ctx, ctx, ctx, ctx, username) +Get a user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user to get | + +### Return type + +[**::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_get_current** +> ::models::User user_get_current(ctx, ctx, ctx, ctx, ctx, ctx, ) +Get the authenticated user + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_get_heatmap_data** +> Vec<::models::UserHeatmapData> user_get_heatmap_data(ctx, ctx, ctx, ctx, ctx, ctx, username) +Get a user's heatmap + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user to get | + +### Return type + +[**Vec<::models::UserHeatmapData>**](UserHeatmapData.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_get_stop_watches** +> Vec<::models::StopWatch> user_get_stop_watches(ctx, ctx, ctx, ctx, ctx, ctx, ) +Get list of all existing stopwatches + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::StopWatch>**](StopWatch.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_get_tokens** +> Vec<::models::AccessToken> user_get_tokens(ctx, ctx, ctx, ctx, ctx, ctx, username) +List the authenticated user's access tokens + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + +### Return type + +[**Vec<::models::AccessToken>**](AccessToken.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_emails** +> Vec<::models::Email> user_list_emails(ctx, ctx, ctx, ctx, ctx, ctx, ) +List the authenticated user's email addresses + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::Email>**](Email.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_followers** +> Vec<::models::User> user_list_followers(ctx, ctx, ctx, ctx, ctx, ctx, username) +List the given user's followers + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_following** +> Vec<::models::User> user_list_following(ctx, ctx, ctx, ctx, ctx, ctx, username) +List the users that the given user is following + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + +### Return type + +[**Vec<::models::User>**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_gpg_keys** +> Vec<::models::GpgKey> user_list_gpg_keys(ctx, ctx, ctx, ctx, ctx, ctx, username) +List the given user's GPG keys + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + +### Return type + +[**Vec<::models::GpgKey>**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_keys** +> Vec<::models::PublicKey> user_list_keys(ctx, ctx, ctx, ctx, ctx, ctx, username, optional) +List the given user's public keys + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of user | + **fingerprint** | **String**| fingerprint of the key | + +### Return type + +[**Vec<::models::PublicKey>**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_repos** +> Vec<::models::Repository> user_list_repos(ctx, ctx, ctx, ctx, ctx, ctx, username) +List the repos owned by the given user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_starred** +> Vec<::models::Repository> user_list_starred(ctx, ctx, ctx, ctx, ctx, ctx, username) +The repos that the given user has starred + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of user | + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_subscriptions** +> Vec<::models::Repository> user_list_subscriptions(ctx, ctx, ctx, ctx, ctx, ctx, username) +List the repositories watched by a user + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **username** | **String**| username of the user | + +### Return type + +[**Vec<::models::Repository>**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_list_teams** +> Vec<::models::Team> user_list_teams(ctx, ctx, ctx, ctx, ctx, ctx, ) +List all the teams a user belongs to + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**Vec<::models::Team>**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_search** +> ::models::InlineResponse2001 user_search(ctx, ctx, ctx, ctx, ctx, ctx, optional) +Search for users + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **q** | **String**| keyword | + **uid** | **i64**| ID of the user to search for | + **limit** | **i32**| maximum number of users to return | + +### Return type + +[**::models::InlineResponse2001**](inline_response_200_1.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **user_tracked_times** +> Vec<::models::TrackedTime> user_tracked_times(ctx, ctx, ctx, ctx, ctx, ctx, owner, repo, user) +List a user's tracked times in a repo + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **user** | **String**| username of user | + +### Return type + +[**Vec<::models::TrackedTime>**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/UserHeatmapData.md b/docs/UserHeatmapData.md new file mode 100644 index 0000000..1403bf0 --- /dev/null +++ b/docs/UserHeatmapData.md @@ -0,0 +1,11 @@ +# UserHeatmapData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contributions** | **i64** | | [optional] [default to null] +**timestamp** | [***::models::TimeStamp**](TimeStamp.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WatchInfo.md b/docs/WatchInfo.md new file mode 100644 index 0000000..dce0fc2 --- /dev/null +++ b/docs/WatchInfo.md @@ -0,0 +1,15 @@ +# WatchInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | [optional] [default to null] +**ignored** | **bool** | | [optional] [default to null] +**reason** | [***Value**](Value.md) | | [optional] [default to null] +**repository_url** | **String** | | [optional] [default to null] +**subscribed** | **bool** | | [optional] [default to null] +**url** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/git_push.sh b/git_push.sh new file mode 100755 index 0000000..ae01b18 --- /dev/null +++ b/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/src/apis/admin_api.rs b/src/apis/admin_api.rs new file mode 100644 index 0000000..0f6ef4b --- /dev/null +++ b/src/apis/admin_api.rs @@ -0,0 +1,1030 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::borrow::Cow; +use std::collections::HashMap; + +use hyper; +use serde_json; +use futures; +use futures::{Future, Stream}; + +use hyper::header::UserAgent; + +use super::{Error, configuration}; + +pub struct AdminApiClient { + configuration: Rc>, +} + +impl AdminApiClient { + pub fn new(configuration: Rc>) -> AdminApiClient { + AdminApiClient { + configuration: configuration, + } + } +} + +pub trait AdminApi { + fn admin_create_org(&self, username: &str, organization: ::models::CreateOrgOption) -> Box>>; + fn admin_create_public_key(&self, username: &str, key: ::models::CreateKeyOption) -> Box>>; + fn admin_create_repo(&self, username: &str, repository: ::models::CreateRepoOption) -> Box>>; + fn admin_create_user(&self, body: ::models::CreateUserOption) -> Box>>; + fn admin_delete_user(&self, username: &str) -> Box>>; + fn admin_delete_user_public_key(&self, username: &str, id: i64) -> Box>>; + fn admin_edit_user(&self, username: &str, body: ::models::EditUserOption) -> Box>>; + fn admin_get_all_orgs(&self, page: i32, limit: i32) -> Box, Error = Error>>; + fn admin_get_all_users(&self, ) -> Box, Error = Error>>; +} + + +implAdminApi for AdminApiClient { + fn admin_create_org(&self, username: &str, organization: ::models::CreateOrgOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/users/{username}/orgs?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&organization).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Organization, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn admin_create_public_key(&self, username: &str, key: ::models::CreateKeyOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/users/{username}/keys?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&key).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::PublicKey, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn admin_create_repo(&self, username: &str, repository: ::models::CreateRepoOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/users/{username}/repos?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&repository).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn admin_create_user(&self, body: ::models::CreateUserOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/users?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::User, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn admin_delete_user(&self, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/users/{username}?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn admin_delete_user_public_key(&self, username: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/users/{username}/keys/{id}?{}", configuration.base_path, query_string, username=username, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn admin_edit_user(&self, username: &str, body: ::models::EditUserOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/users/{username}?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::User, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn admin_get_all_orgs(&self, page: i32, limit: i32) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("page", &page.to_string()); + query.append_pair("limit", &limit.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/orgs?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn admin_get_all_users(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/admin/users?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + +} diff --git a/src/apis/client.rs b/src/apis/client.rs new file mode 100644 index 0000000..aaecec5 --- /dev/null +++ b/src/apis/client.rs @@ -0,0 +1,56 @@ +use std::rc::Rc; + +use hyper; +use super::configuration::Configuration; + +pub struct APIClient { + configuration: Rc>, + admin_api: Box<::apis::AdminApi>, + issue_api: Box<::apis::IssueApi>, + miscellaneous_api: Box<::apis::MiscellaneousApi>, + organization_api: Box<::apis::OrganizationApi>, + repository_api: Box<::apis::RepositoryApi>, + user_api: Box<::apis::UserApi>, +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient { + let rc = Rc::new(configuration); + + APIClient { + configuration: rc.clone(), + admin_api: Box::new(::apis::AdminApiClient::new(rc.clone())), + issue_api: Box::new(::apis::IssueApiClient::new(rc.clone())), + miscellaneous_api: Box::new(::apis::MiscellaneousApiClient::new(rc.clone())), + organization_api: Box::new(::apis::OrganizationApiClient::new(rc.clone())), + repository_api: Box::new(::apis::RepositoryApiClient::new(rc.clone())), + user_api: Box::new(::apis::UserApiClient::new(rc.clone())), + } + } + + pub fn admin_api(&self) -> &::apis::AdminApi{ + self.admin_api.as_ref() + } + + pub fn issue_api(&self) -> &::apis::IssueApi{ + self.issue_api.as_ref() + } + + pub fn miscellaneous_api(&self) -> &::apis::MiscellaneousApi{ + self.miscellaneous_api.as_ref() + } + + pub fn organization_api(&self) -> &::apis::OrganizationApi{ + self.organization_api.as_ref() + } + + pub fn repository_api(&self) -> &::apis::RepositoryApi{ + self.repository_api.as_ref() + } + + pub fn user_api(&self) -> &::apis::UserApi{ + self.user_api.as_ref() + } + + +} diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs new file mode 100644 index 0000000..086c3e2 --- /dev/null +++ b/src/apis/configuration.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +use hyper; +use std::collections::HashMap; + +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: hyper::client::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + pub fn new(client: hyper::client::Client) -> Configuration { + Configuration { + base_path: "http://localhost/api/v1".to_owned(), + user_agent: Some("Swagger-Codegen/1.1.1/rust".to_owned()), + client: client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} diff --git a/src/apis/issue_api.rs b/src/apis/issue_api.rs new file mode 100644 index 0000000..0fa43cd --- /dev/null +++ b/src/apis/issue_api.rs @@ -0,0 +1,4831 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::borrow::Cow; +use std::collections::HashMap; + +use hyper; +use serde_json; +use futures; +use futures::{Future, Stream}; + +use hyper::header::UserAgent; + +use super::{Error, configuration}; + +pub struct IssueApiClient { + configuration: Rc>, +} + +impl IssueApiClient { + pub fn new(configuration: Rc>) -> IssueApiClient { + IssueApiClient { + configuration: configuration, + } + } +} + +pub trait IssueApi { + fn issue_add_label(&self, owner: &str, repo: &str, index: i64, body: ::models::IssueLabelsOption) -> Box, Error = Error>>; + fn issue_add_subscription(&self, owner: &str, repo: &str, index: i64, user: &str) -> Box>>; + fn issue_add_time(&self, owner: &str, repo: &str, index: i64, body: ::models::AddTimeOption) -> Box>>; + fn issue_clear_labels(&self, owner: &str, repo: &str, index: i64) -> Box>>; + fn issue_create_comment(&self, owner: &str, repo: &str, index: i64, body: ::models::CreateIssueCommentOption) -> Box>>; + fn issue_create_issue(&self, owner: &str, repo: &str, body: ::models::CreateIssueOption) -> Box>>; + fn issue_create_label(&self, owner: &str, repo: &str, body: ::models::CreateLabelOption) -> Box>>; + fn issue_create_milestone(&self, owner: &str, repo: &str, body: ::models::CreateMilestoneOption) -> Box>>; + fn issue_delete_comment(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn issue_delete_comment_deprecated(&self, owner: &str, repo: &str, index: i32, id: i64) -> Box>>; + fn issue_delete_comment_reaction(&self, owner: &str, repo: &str, id: i64, content: ::models::EditReactionOption) -> Box>>; + fn issue_delete_issue_reaction(&self, owner: &str, repo: &str, index: i64, content: ::models::EditReactionOption) -> Box>>; + fn issue_delete_label(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn issue_delete_milestone(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn issue_delete_stop_watch(&self, owner: &str, repo: &str, index: i64) -> Box>>; + fn issue_delete_subscription(&self, owner: &str, repo: &str, index: i64, user: &str) -> Box>>; + fn issue_delete_time(&self, owner: &str, repo: &str, index: i64, id: i64) -> Box>>; + fn issue_edit_comment(&self, owner: &str, repo: &str, id: i64, body: ::models::EditIssueCommentOption) -> Box>>; + fn issue_edit_comment_deprecated(&self, owner: &str, repo: &str, index: i32, id: i64, body: ::models::EditIssueCommentOption) -> Box>>; + fn issue_edit_issue(&self, owner: &str, repo: &str, index: i64, body: ::models::EditIssueOption) -> Box>>; + fn issue_edit_issue_deadline(&self, owner: &str, repo: &str, index: i64, body: ::models::EditDeadlineOption) -> Box>>; + fn issue_edit_label(&self, owner: &str, repo: &str, id: i64, body: ::models::EditLabelOption) -> Box>>; + fn issue_edit_milestone(&self, owner: &str, repo: &str, id: i64, body: ::models::EditMilestoneOption) -> Box>>; + fn issue_get_comment_reactions(&self, owner: &str, repo: &str, id: i64) -> Box, Error = Error>>; + fn issue_get_comments(&self, owner: &str, repo: &str, index: i64, since: &str) -> Box, Error = Error>>; + fn issue_get_issue(&self, owner: &str, repo: &str, index: i64) -> Box>>; + fn issue_get_issue_reactions(&self, owner: &str, repo: &str, index: i64) -> Box, Error = Error>>; + fn issue_get_label(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn issue_get_labels(&self, owner: &str, repo: &str, index: i64) -> Box, Error = Error>>; + fn issue_get_milestone(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn issue_get_milestones_list(&self, owner: &str, repo: &str, state: &str) -> Box, Error = Error>>; + fn issue_get_repo_comments(&self, owner: &str, repo: &str, since: &str) -> Box, Error = Error>>; + fn issue_list_issues(&self, owner: &str, repo: &str, state: &str, labels: &str, page: i32, q: &str, _type: &str) -> Box, Error = Error>>; + fn issue_list_labels(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn issue_post_comment_reaction(&self, owner: &str, repo: &str, id: i64, content: ::models::EditReactionOption) -> Box>>; + fn issue_post_issue_reaction(&self, owner: &str, repo: &str, index: i64, content: ::models::EditReactionOption) -> Box>>; + fn issue_remove_label(&self, owner: &str, repo: &str, index: i64, id: i64) -> Box>>; + fn issue_replace_labels(&self, owner: &str, repo: &str, index: i64, body: ::models::IssueLabelsOption) -> Box, Error = Error>>; + fn issue_reset_time(&self, owner: &str, repo: &str, index: i64) -> Box>>; + fn issue_search_issues(&self, state: &str, labels: &str, page: i32, q: &str, priority_repo_id: i64, _type: &str) -> Box, Error = Error>>; + fn issue_start_stop_watch(&self, owner: &str, repo: &str, index: i64) -> Box>>; + fn issue_stop_stop_watch(&self, owner: &str, repo: &str, index: i64) -> Box>>; + fn issue_subscriptions(&self, owner: &str, repo: &str, index: i64) -> Box, Error = Error>>; + fn issue_tracked_times(&self, owner: &str, repo: &str, index: i64) -> Box, Error = Error>>; +} + + +implIssueApi for IssueApiClient { + fn issue_add_label(&self, owner: &str, repo: &str, index: i64, body: ::models::IssueLabelsOption) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_add_subscription(&self, owner: &str, repo: &str, index: i64, user: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index, user=user); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_add_time(&self, owner: &str, repo: &str, index: i64, body: ::models::AddTimeOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::TrackedTime, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_clear_labels(&self, owner: &str, repo: &str, index: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_create_comment(&self, owner: &str, repo: &str, index: i64, body: ::models::CreateIssueCommentOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Comment, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_create_issue(&self, owner: &str, repo: &str, body: ::models::CreateIssueOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Issue, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_create_label(&self, owner: &str, repo: &str, body: ::models::CreateLabelOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/labels?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Label, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_create_milestone(&self, owner: &str, repo: &str, body: ::models::CreateMilestoneOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/milestones?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Milestone, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_delete_comment(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_delete_comment_deprecated(&self, owner: &str, repo: &str, index: i32, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_delete_comment_reaction(&self, owner: &str, repo: &str, id: i64, content: ::models::EditReactionOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&content).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_delete_issue_reaction(&self, owner: &str, repo: &str, index: i64, content: ::models::EditReactionOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&content).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_delete_label(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_delete_milestone(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_delete_stop_watch(&self, owner: &str, repo: &str, index: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/delete?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_delete_subscription(&self, owner: &str, repo: &str, index: i64, user: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index, user=user); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_delete_time(&self, owner: &str, repo: &str, index: i64, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_edit_comment(&self, owner: &str, repo: &str, id: i64, body: ::models::EditIssueCommentOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Comment, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_edit_comment_deprecated(&self, owner: &str, repo: &str, index: i32, id: i64, body: ::models::EditIssueCommentOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Comment, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_edit_issue(&self, owner: &str, repo: &str, index: i64, body: ::models::EditIssueOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Issue, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_edit_issue_deadline(&self, owner: &str, repo: &str, index: i64, body: ::models::EditDeadlineOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/deadline?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::IssueDeadline, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_edit_label(&self, owner: &str, repo: &str, id: i64, body: ::models::EditLabelOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Label, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_edit_milestone(&self, owner: &str, repo: &str, id: i64, body: ::models::EditMilestoneOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Milestone, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_comment_reactions(&self, owner: &str, repo: &str, id: i64) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_comments(&self, owner: &str, repo: &str, index: i64, since: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("since", &since.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_issue(&self, owner: &str, repo: &str, index: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Issue, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_issue_reactions(&self, owner: &str, repo: &str, index: i64) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_label(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Label, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_labels(&self, owner: &str, repo: &str, index: i64) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_milestone(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Milestone, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_milestones_list(&self, owner: &str, repo: &str, state: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("state", &state.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/milestones?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_get_repo_comments(&self, owner: &str, repo: &str, since: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("since", &since.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/comments?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_list_issues(&self, owner: &str, repo: &str, state: &str, labels: &str, page: i32, q: &str, _type: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("state", &state.to_string()); + query.append_pair("labels", &labels.to_string()); + query.append_pair("page", &page.to_string()); + query.append_pair("q", &q.to_string()); + query.append_pair("type", &_type.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_list_labels(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/labels?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_post_comment_reaction(&self, owner: &str, repo: &str, id: i64, content: ::models::EditReactionOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&content).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Reaction, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_post_issue_reaction(&self, owner: &str, repo: &str, index: i64, content: ::models::EditReactionOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&content).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Reaction, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_remove_label(&self, owner: &str, repo: &str, index: i64, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_replace_labels(&self, owner: &str, repo: &str, index: i64, body: ::models::IssueLabelsOption) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_reset_time(&self, owner: &str, repo: &str, index: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_search_issues(&self, state: &str, labels: &str, page: i32, q: &str, priority_repo_id: i64, _type: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("state", &state.to_string()); + query.append_pair("labels", &labels.to_string()); + query.append_pair("page", &page.to_string()); + query.append_pair("q", &q.to_string()); + query.append_pair("priority_repo_id", &priority_repo_id.to_string()); + query.append_pair("type", &_type.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/issues/search?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_start_stop_watch(&self, owner: &str, repo: &str, index: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/start?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_stop_stop_watch(&self, owner: &str, repo: &str, index: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/stop?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn issue_subscriptions(&self, owner: &str, repo: &str, index: i64) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn issue_tracked_times(&self, owner: &str, repo: &str, index: i64) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + +} diff --git a/src/apis/miscellaneous_api.rs b/src/apis/miscellaneous_api.rs new file mode 100644 index 0000000..63729d0 --- /dev/null +++ b/src/apis/miscellaneous_api.rs @@ -0,0 +1,482 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::borrow::Cow; +use std::collections::HashMap; + +use hyper; +use serde_json; +use futures; +use futures::{Future, Stream}; + +use hyper::header::UserAgent; + +use super::{Error, configuration}; + +pub struct MiscellaneousApiClient { + configuration: Rc>, +} + +impl MiscellaneousApiClient { + pub fn new(configuration: Rc>) -> MiscellaneousApiClient { + MiscellaneousApiClient { + configuration: configuration, + } + } +} + +pub trait MiscellaneousApi { + fn get_signing_key(&self, ) -> Box>>; + fn get_version(&self, ) -> Box>>; + fn render_markdown(&self, body: ::models::MarkdownOption) -> Box>>; + fn render_markdown_raw(&self, body: &str) -> Box>>; +} + + +implMiscellaneousApi for MiscellaneousApiClient { + fn get_signing_key(&self, ) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/signing-key.gpg?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn get_version(&self, ) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/version?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::ServerVersion, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn render_markdown(&self, body: ::models::MarkdownOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/markdown?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn render_markdown_raw(&self, body: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/markdown/raw?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + +} diff --git a/src/apis/mod.rs b/src/apis/mod.rs new file mode 100644 index 0000000..5307dfd --- /dev/null +++ b/src/apis/mod.rs @@ -0,0 +1,67 @@ +use hyper; +use serde; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Hyper(hyper::Error), + Serde(serde_json::Error), + ApiError(ApiError), +} + +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub content: Option, +} + +impl<'de, T> From<(hyper::StatusCode, &'de [u8])> for Error + where T: serde::Deserialize<'de> { + fn from(e: (hyper::StatusCode, &'de [u8])) -> Self { + if e.1.len() == 0 { + return Error::ApiError(ApiError{ + code: e.0, + content: None, + }); + } + match serde_json::from_slice::(e.1) { + Ok(t) => Error::ApiError(ApiError{ + code: e.0, + content: Some(t), + }), + Err(e) => { + Error::from(e) + } + } + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + return Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + return Error::Serde(e) + } +} + +use super::models::*; + +mod admin_api; +pub use self::admin_api::{ AdminApi, AdminApiClient }; +mod issue_api; +pub use self::issue_api::{ IssueApi, IssueApiClient }; +mod miscellaneous_api; +pub use self::miscellaneous_api::{ MiscellaneousApi, MiscellaneousApiClient }; +mod organization_api; +pub use self::organization_api::{ OrganizationApi, OrganizationApiClient }; +mod repository_api; +pub use self::repository_api::{ RepositoryApi, RepositoryApiClient }; +mod user_api; +pub use self::user_api::{ UserApi, UserApiClient }; + +pub mod configuration; +pub mod client; diff --git a/src/apis/organization_api.rs b/src/apis/organization_api.rs new file mode 100644 index 0000000..87aa6f8 --- /dev/null +++ b/src/apis/organization_api.rs @@ -0,0 +1,3602 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::borrow::Cow; +use std::collections::HashMap; + +use hyper; +use serde_json; +use futures; +use futures::{Future, Stream}; + +use hyper::header::UserAgent; + +use super::{Error, configuration}; + +pub struct OrganizationApiClient { + configuration: Rc>, +} + +impl OrganizationApiClient { + pub fn new(configuration: Rc>) -> OrganizationApiClient { + OrganizationApiClient { + configuration: configuration, + } + } +} + +pub trait OrganizationApi { + fn create_org_repo(&self, org: &str, body: ::models::CreateRepoOption) -> Box>>; + fn org_add_team_member(&self, id: i64, username: &str) -> Box>>; + fn org_add_team_repository(&self, id: i64, org: &str, repo: &str) -> Box>>; + fn org_conceal_member(&self, org: &str, username: &str) -> Box>>; + fn org_create(&self, organization: ::models::CreateOrgOption) -> Box>>; + fn org_create_hook(&self, org: &str, body: ::models::CreateHookOption) -> Box>>; + fn org_create_team(&self, org: &str, body: ::models::CreateTeamOption) -> Box>>; + fn org_delete(&self, org: &str) -> Box>>; + fn org_delete_hook(&self, org: &str, id: i64) -> Box>>; + fn org_delete_member(&self, org: &str, username: &str) -> Box>>; + fn org_delete_team(&self, id: i64) -> Box>>; + fn org_edit(&self, org: &str, body: ::models::EditOrgOption) -> Box>>; + fn org_edit_hook(&self, org: &str, id: i64, body: ::models::EditHookOption) -> Box>>; + fn org_edit_team(&self, id: i32, body: ::models::EditTeamOption) -> Box>>; + fn org_get(&self, org: &str) -> Box>>; + fn org_get_hook(&self, org: &str, id: i64) -> Box>>; + fn org_get_team(&self, id: i64) -> Box>>; + fn org_is_member(&self, org: &str, username: &str) -> Box>>; + fn org_is_public_member(&self, org: &str, username: &str) -> Box>>; + fn org_list_current_user_orgs(&self, ) -> Box, Error = Error>>; + fn org_list_hooks(&self, org: &str) -> Box, Error = Error>>; + fn org_list_members(&self, org: &str) -> Box, Error = Error>>; + fn org_list_public_members(&self, org: &str) -> Box, Error = Error>>; + fn org_list_repos(&self, org: &str) -> Box, Error = Error>>; + fn org_list_team_member(&self, id: i64, username: &str) -> Box>>; + fn org_list_team_members(&self, id: i64) -> Box, Error = Error>>; + fn org_list_team_repos(&self, id: i64) -> Box, Error = Error>>; + fn org_list_teams(&self, org: &str) -> Box, Error = Error>>; + fn org_list_user_orgs(&self, username: &str) -> Box, Error = Error>>; + fn org_publicize_member(&self, org: &str, username: &str) -> Box>>; + fn org_remove_team_member(&self, id: i64, username: &str) -> Box>>; + fn org_remove_team_repository(&self, id: i64, org: &str, repo: &str) -> Box>>; + fn team_search(&self, org: &str, q: &str, include_desc: bool, limit: i32, page: i32) -> Box>>; +} + + +implOrganizationApi for OrganizationApiClient { + fn create_org_repo(&self, org: &str, body: ::models::CreateRepoOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/org/{org}/repos?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_add_team_member(&self, id: i64, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}/members/{username}?{}", configuration.base_path, query_string, id=id, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_add_team_repository(&self, id: i64, org: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}/repos/{org}/{repo}?{}", configuration.base_path, query_string, id=id, org=org, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_conceal_member(&self, org: &str, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/public_members/{username}?{}", configuration.base_path, query_string, org=org, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_create(&self, organization: ::models::CreateOrgOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&organization).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Organization, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_create_hook(&self, org: &str, body: ::models::CreateHookOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/hooks/?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Hook, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_create_team(&self, org: &str, body: ::models::CreateTeamOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/teams?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Team, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_delete(&self, org: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_delete_hook(&self, org: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/hooks/{id}?{}", configuration.base_path, query_string, org=org, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_delete_member(&self, org: &str, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/members/{username}?{}", configuration.base_path, query_string, org=org, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_delete_team(&self, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_edit(&self, org: &str, body: ::models::EditOrgOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Organization, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_edit_hook(&self, org: &str, id: i64, body: ::models::EditHookOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/hooks/{id}?{}", configuration.base_path, query_string, org=org, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Hook, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_edit_team(&self, id: i32, body: ::models::EditTeamOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Team, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_get(&self, org: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Organization, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_get_hook(&self, org: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/hooks/{id}?{}", configuration.base_path, query_string, org=org, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Hook, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_get_team(&self, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Team, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_is_member(&self, org: &str, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/members/{username}?{}", configuration.base_path, query_string, org=org, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_is_public_member(&self, org: &str, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/public_members/{username}?{}", configuration.base_path, query_string, org=org, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_list_current_user_orgs(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/orgs?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_hooks(&self, org: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/hooks?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_members(&self, org: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/members?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_public_members(&self, org: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/public_members?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_repos(&self, org: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/repos?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_team_member(&self, id: i64, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}/members/{username}?{}", configuration.base_path, query_string, id=id, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::User, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_team_members(&self, id: i64) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}/members?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_team_repos(&self, id: i64) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}/repos?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_teams(&self, org: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/teams?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_list_user_orgs(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/orgs?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn org_publicize_member(&self, org: &str, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/public_members/{username}?{}", configuration.base_path, query_string, org=org, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_remove_team_member(&self, id: i64, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}/members/{username}?{}", configuration.base_path, query_string, id=id, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn org_remove_team_repository(&self, id: i64, org: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/teams/{id}/repos/{org}/{repo}?{}", configuration.base_path, query_string, id=id, org=org, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn team_search(&self, org: &str, q: &str, include_desc: bool, limit: i32, page: i32) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("q", &q.to_string()); + query.append_pair("include_desc", &include_desc.to_string()); + query.append_pair("limit", &limit.to_string()); + query.append_pair("page", &page.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/orgs/{org}/teams/search?{}", configuration.base_path, query_string, org=org); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::InlineResponse200, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + +} diff --git a/src/apis/repository_api.rs b/src/apis/repository_api.rs new file mode 100644 index 0000000..7fa90fd --- /dev/null +++ b/src/apis/repository_api.rs @@ -0,0 +1,8414 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::borrow::Cow; +use std::collections::HashMap; + +use hyper; +use serde_json; +use futures; +use futures::{Future, Stream}; + +use hyper::header::UserAgent; + +use super::{Error, configuration}; + +pub struct RepositoryApiClient { + configuration: Rc>, +} + +impl RepositoryApiClient { + pub fn new(configuration: Rc>) -> RepositoryApiClient { + RepositoryApiClient { + configuration: configuration, + } + } +} + +pub trait RepositoryApi { + fn create_current_user_repo(&self, body: ::models::CreateRepoOption) -> Box>>; + fn create_fork(&self, owner: &str, repo: &str, body: ::models::CreateForkOption) -> Box>>; + fn get_blob(&self, owner: &str, repo: &str, sha: &str) -> Box>>; + fn get_tag(&self, owner: &str, repo: &str, sha: &str) -> Box>>; + fn get_tree(&self, owner: &str, repo: &str, sha: &str, recursive: bool, page: i32, per_page: i32) -> Box>>; + fn list_forks(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_add_collaborator(&self, owner: &str, repo: &str, collaborator: &str, body: ::models::AddCollaboratorOption) -> Box>>; + fn repo_add_topc(&self, owner: &str, repo: &str, topic: &str) -> Box>>; + fn repo_check_collaborator(&self, owner: &str, repo: &str, collaborator: &str) -> Box>>; + fn repo_create_file(&self, owner: &str, repo: &str, filepath: &str, body: ::models::CreateFileOptions) -> Box>>; + fn repo_create_hook(&self, owner: &str, repo: &str, body: ::models::CreateHookOption) -> Box>>; + fn repo_create_key(&self, owner: &str, repo: &str, body: ::models::CreateKeyOption) -> Box>>; + fn repo_create_pull_request(&self, owner: &str, repo: &str, body: ::models::CreatePullRequestOption) -> Box>>; + fn repo_create_release(&self, owner: &str, repo: &str, body: ::models::CreateReleaseOption) -> Box>>; + fn repo_create_release_attachment(&self, owner: &str, repo: &str, id: i64, attachment: ::models::File, name: &str) -> Box>>; + fn repo_create_status(&self, owner: &str, repo: &str, sha: &str, body: ::models::CreateStatusOption) -> Box>>; + fn repo_delete(&self, owner: &str, repo: &str) -> Box>>; + fn repo_delete_collaborator(&self, owner: &str, repo: &str, collaborator: &str) -> Box>>; + fn repo_delete_file(&self, owner: &str, repo: &str, filepath: &str, body: ::models::DeleteFileOptions) -> Box>>; + fn repo_delete_git_hook(&self, owner: &str, repo: &str, id: &str) -> Box>>; + fn repo_delete_hook(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn repo_delete_key(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn repo_delete_release(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn repo_delete_release_attachment(&self, owner: &str, repo: &str, id: i64, attachment_id: i64) -> Box>>; + fn repo_delete_topic(&self, owner: &str, repo: &str, topic: &str) -> Box>>; + fn repo_edit(&self, owner: &str, repo: &str, body: ::models::EditRepoOption) -> Box>>; + fn repo_edit_git_hook(&self, owner: &str, repo: &str, id: &str, body: ::models::EditGitHookOption) -> Box>>; + fn repo_edit_hook(&self, owner: &str, repo: &str, id: i64, body: ::models::EditHookOption) -> Box>>; + fn repo_edit_pull_request(&self, owner: &str, repo: &str, index: i64, body: ::models::EditPullRequestOption) -> Box>>; + fn repo_edit_release(&self, owner: &str, repo: &str, id: i64, body: ::models::EditReleaseOption) -> Box>>; + fn repo_edit_release_attachment(&self, owner: &str, repo: &str, id: i64, attachment_id: i64, body: ::models::EditAttachmentOptions) -> Box>>; + fn repo_get(&self, owner: &str, repo: &str) -> Box>>; + fn repo_get_all_commits(&self, owner: &str, repo: &str, sha: &str, page: i32) -> Box, Error = Error>>; + fn repo_get_archive(&self, owner: &str, repo: &str, archive: &str) -> Box>>; + fn repo_get_branch(&self, owner: &str, repo: &str, branch: &str) -> Box>>; + fn repo_get_by_id(&self, id: i64) -> Box>>; + fn repo_get_combined_status_by_ref(&self, owner: &str, repo: &str, _ref: &str, page: i32) -> Box>>; + fn repo_get_contents(&self, owner: &str, repo: &str, filepath: &str, _ref: &str) -> Box>>; + fn repo_get_contents_list(&self, owner: &str, repo: &str, _ref: &str) -> Box, Error = Error>>; + fn repo_get_editor_config(&self, owner: &str, repo: &str, filepath: &str) -> Box>>; + fn repo_get_git_hook(&self, owner: &str, repo: &str, id: &str) -> Box>>; + fn repo_get_hook(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn repo_get_key(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn repo_get_pull_request(&self, owner: &str, repo: &str, index: i64) -> Box>>; + fn repo_get_raw_file(&self, owner: &str, repo: &str, filepath: &str) -> Box>>; + fn repo_get_release(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn repo_get_release_attachment(&self, owner: &str, repo: &str, id: i64, attachment_id: i64) -> Box>>; + fn repo_get_single_commit(&self, owner: &str, repo: &str, sha: &str) -> Box>>; + fn repo_list_all_git_refs(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_list_branches(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_list_collaborators(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_list_git_hooks(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_list_git_refs(&self, owner: &str, repo: &str, _ref: &str) -> Box, Error = Error>>; + fn repo_list_hooks(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_list_keys(&self, owner: &str, repo: &str, key_id: i32, fingerprint: &str) -> Box, Error = Error>>; + fn repo_list_pull_requests(&self, owner: &str, repo: &str, page: i32, state: &str, sort: &str, milestone: i64, labels: Vec) -> Box, Error = Error>>; + fn repo_list_release_attachments(&self, owner: &str, repo: &str, id: i64) -> Box, Error = Error>>; + fn repo_list_releases(&self, owner: &str, repo: &str, page: i32, per_page: i32) -> Box, Error = Error>>; + fn repo_list_stargazers(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_list_statuses(&self, owner: &str, repo: &str, sha: &str, page: i32, sort: &str, state: &str) -> Box, Error = Error>>; + fn repo_list_subscribers(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_list_tags(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_list_topics(&self, owner: &str, repo: &str) -> Box>>; + fn repo_merge_pull_request(&self, owner: &str, repo: &str, index: i64, body: ::models::MergePullRequestOption) -> Box>>; + fn repo_migrate(&self, body: ::models::MigrateRepoForm) -> Box>>; + fn repo_mirror_sync(&self, owner: &str, repo: &str) -> Box>>; + fn repo_pull_request_is_merged(&self, owner: &str, repo: &str, index: i64) -> Box>>; + fn repo_search(&self, q: &str, topic: bool, include_desc: bool, uid: i64, priority_owner_id: i64, starred_by: i64, private: bool, template: bool, page: i32, limit: i32, mode: &str, exclusive: bool, sort: &str, order: &str) -> Box>>; + fn repo_signing_key(&self, owner: &str, repo: &str) -> Box>>; + fn repo_test_hook(&self, owner: &str, repo: &str, id: i64) -> Box>>; + fn repo_tracked_times(&self, owner: &str, repo: &str) -> Box, Error = Error>>; + fn repo_update_file(&self, owner: &str, repo: &str, filepath: &str, body: ::models::UpdateFileOptions) -> Box>>; + fn repo_update_topics(&self, owner: &str, repo: &str, body: ::models::RepoTopicOptions) -> Box>>; + fn topic_search(&self, q: &str) -> Box, Error = Error>>; + fn user_current_check_subscription(&self, owner: &str, repo: &str) -> Box>>; + fn user_current_delete_subscription(&self, owner: &str, repo: &str) -> Box>>; + fn user_current_put_subscription(&self, owner: &str, repo: &str) -> Box>>; +} + + +implRepositoryApi for RepositoryApiClient { + fn create_current_user_repo(&self, body: ::models::CreateRepoOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/repos?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn create_fork(&self, owner: &str, repo: &str, body: ::models::CreateForkOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/forks?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn get_blob(&self, owner: &str, repo: &str, sha: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/git/blobs/{sha}?{}", configuration.base_path, query_string, owner=owner, repo=repo, sha=sha); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::GitBlobResponse, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn get_tag(&self, owner: &str, repo: &str, sha: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/git/tags/{sha}?{}", configuration.base_path, query_string, owner=owner, repo=repo, sha=sha); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::AnnotatedTag, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn get_tree(&self, owner: &str, repo: &str, sha: &str, recursive: bool, page: i32, per_page: i32) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("recursive", &recursive.to_string()); + query.append_pair("page", &page.to_string()); + query.append_pair("per_page", &per_page.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/git/trees/{sha}?{}", configuration.base_path, query_string, owner=owner, repo=repo, sha=sha); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::GitTreeResponse, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn list_forks(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/forks?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_add_collaborator(&self, owner: &str, repo: &str, collaborator: &str, body: ::models::AddCollaboratorOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{collaborator}?{}", configuration.base_path, query_string, owner=owner, repo=repo, collaborator=collaborator); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_add_topc(&self, owner: &str, repo: &str, topic: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/topics/{topic}?{}", configuration.base_path, query_string, owner=owner, repo=repo, topic=topic); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_check_collaborator(&self, owner: &str, repo: &str, collaborator: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{collaborator}?{}", configuration.base_path, query_string, owner=owner, repo=repo, collaborator=collaborator); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_create_file(&self, owner: &str, repo: &str, filepath: &str, body: ::models::CreateFileOptions) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/contents/{filepath}?{}", configuration.base_path, query_string, owner=owner, repo=repo, filepath=filepath); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::FileResponse, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_create_hook(&self, owner: &str, repo: &str, body: ::models::CreateHookOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Hook, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_create_key(&self, owner: &str, repo: &str, body: ::models::CreateKeyOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/keys?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::DeployKey, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_create_pull_request(&self, owner: &str, repo: &str, body: ::models::CreatePullRequestOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/pulls?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::PullRequest, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_create_release(&self, owner: &str, repo: &str, body: ::models::CreateReleaseOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Release, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_create_release_attachment(&self, owner: &str, repo: &str, id: i64, attachment: ::models::File, name: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("name", &name.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Attachment, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_create_status(&self, owner: &str, repo: &str, sha: &str, body: ::models::CreateStatusOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/statuses/{sha}?{}", configuration.base_path, query_string, owner=owner, repo=repo, sha=sha); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Status, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_delete(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_delete_collaborator(&self, owner: &str, repo: &str, collaborator: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{collaborator}?{}", configuration.base_path, query_string, owner=owner, repo=repo, collaborator=collaborator); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_delete_file(&self, owner: &str, repo: &str, filepath: &str, body: ::models::DeleteFileOptions) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/contents/{filepath}?{}", configuration.base_path, query_string, owner=owner, repo=repo, filepath=filepath); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::FileDeleteResponse, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_delete_git_hook(&self, owner: &str, repo: &str, id: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks/git/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_delete_hook(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_delete_key(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/keys/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_delete_release(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_delete_release_attachment(&self, owner: &str, repo: &str, id: i64, attachment_id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id, attachment_id=attachment_id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_delete_topic(&self, owner: &str, repo: &str, topic: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/topics/{topic}?{}", configuration.base_path, query_string, owner=owner, repo=repo, topic=topic); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_edit(&self, owner: &str, repo: &str, body: ::models::EditRepoOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_edit_git_hook(&self, owner: &str, repo: &str, id: &str, body: ::models::EditGitHookOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks/git/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::GitHook, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_edit_hook(&self, owner: &str, repo: &str, id: i64, body: ::models::EditHookOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Hook, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_edit_pull_request(&self, owner: &str, repo: &str, index: i64, body: ::models::EditPullRequestOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::PullRequest, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_edit_release(&self, owner: &str, repo: &str, id: i64, body: ::models::EditReleaseOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Release, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_edit_release_attachment(&self, owner: &str, repo: &str, id: i64, attachment_id: i64, body: ::models::EditAttachmentOptions) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Patch; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id, attachment_id=attachment_id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Attachment, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_all_commits(&self, owner: &str, repo: &str, sha: &str, page: i32) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("sha", &sha.to_string()); + query.append_pair("page", &page.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/commits?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_archive(&self, owner: &str, repo: &str, archive: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/archive/{archive}?{}", configuration.base_path, query_string, owner=owner, repo=repo, archive=archive); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_get_branch(&self, owner: &str, repo: &str, branch: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}?{}", configuration.base_path, query_string, owner=owner, repo=repo, branch=branch); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Branch, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_by_id(&self, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repositories/{id}?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_combined_status_by_ref(&self, owner: &str, repo: &str, _ref: &str, page: i32) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("page", &page.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/commits/{ref}/statuses?{}", configuration.base_path, query_string, owner=owner, repo=repo, ref=_ref); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Status, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_contents(&self, owner: &str, repo: &str, filepath: &str, _ref: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("ref", &_ref.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/contents/{filepath}?{}", configuration.base_path, query_string, owner=owner, repo=repo, filepath=filepath); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::ContentsResponse, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_contents_list(&self, owner: &str, repo: &str, _ref: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("ref", &_ref.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/contents?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_editor_config(&self, owner: &str, repo: &str, filepath: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/editorconfig/{filepath}?{}", configuration.base_path, query_string, owner=owner, repo=repo, filepath=filepath); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_get_git_hook(&self, owner: &str, repo: &str, id: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks/git/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::GitHook, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_hook(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Hook, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_key(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/keys/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::DeployKey, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_pull_request(&self, owner: &str, repo: &str, index: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::PullRequest, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_raw_file(&self, owner: &str, repo: &str, filepath: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/raw/{filepath}?{}", configuration.base_path, query_string, owner=owner, repo=repo, filepath=filepath); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_get_release(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Release, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_release_attachment(&self, owner: &str, repo: &str, id: i64, attachment_id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id, attachment_id=attachment_id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Attachment, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_get_single_commit(&self, owner: &str, repo: &str, sha: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/git/commits/{sha}?{}", configuration.base_path, query_string, owner=owner, repo=repo, sha=sha); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Commit, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_all_git_refs(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/git/refs?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_branches(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/branches?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_collaborators(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/collaborators?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_git_hooks(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks/git?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_git_refs(&self, owner: &str, repo: &str, _ref: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/git/refs/{ref}?{}", configuration.base_path, query_string, owner=owner, repo=repo, ref=_ref); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_hooks(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_keys(&self, owner: &str, repo: &str, key_id: i32, fingerprint: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("key_id", &key_id.to_string()); + query.append_pair("fingerprint", &fingerprint.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/keys?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_pull_requests(&self, owner: &str, repo: &str, page: i32, state: &str, sort: &str, milestone: i64, labels: Vec) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("page", &page.to_string()); + query.append_pair("state", &state.to_string()); + query.append_pair("sort", &sort.to_string()); + query.append_pair("milestone", &milestone.to_string()); + query.append_pair("labels", &labels.join(",").to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/pulls?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_release_attachments(&self, owner: &str, repo: &str, id: i64) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_releases(&self, owner: &str, repo: &str, page: i32, per_page: i32) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("page", &page.to_string()); + query.append_pair("per_page", &per_page.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/releases?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_stargazers(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/stargazers?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_statuses(&self, owner: &str, repo: &str, sha: &str, page: i32, sort: &str, state: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("page", &page.to_string()); + query.append_pair("sort", &sort.to_string()); + query.append_pair("state", &state.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/statuses/{sha}?{}", configuration.base_path, query_string, owner=owner, repo=repo, sha=sha); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_subscribers(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/subscribers?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_tags(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/tags?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_list_topics(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/topics?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::TopicName, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_merge_pull_request(&self, owner: &str, repo: &str, index: i64, body: ::models::MergePullRequestOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/merge?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_migrate(&self, body: ::models::MigrateRepoForm) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/migrate?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_mirror_sync(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/mirror-sync?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_pull_request_is_merged(&self, owner: &str, repo: &str, index: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/merge?{}", configuration.base_path, query_string, owner=owner, repo=repo, index=index); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_search(&self, q: &str, topic: bool, include_desc: bool, uid: i64, priority_owner_id: i64, starred_by: i64, private: bool, template: bool, page: i32, limit: i32, mode: &str, exclusive: bool, sort: &str, order: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("q", &q.to_string()); + query.append_pair("topic", &topic.to_string()); + query.append_pair("includeDesc", &include_desc.to_string()); + query.append_pair("uid", &uid.to_string()); + query.append_pair("priority_owner_id", &priority_owner_id.to_string()); + query.append_pair("starredBy", &starred_by.to_string()); + query.append_pair("private", &private.to_string()); + query.append_pair("template", &template.to_string()); + query.append_pair("page", &page.to_string()); + query.append_pair("limit", &limit.to_string()); + query.append_pair("mode", &mode.to_string()); + query.append_pair("exclusive", &exclusive.to_string()); + query.append_pair("sort", &sort.to_string()); + query.append_pair("order", &order.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/search?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::SearchResults, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_signing_key(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/signing-key.gpg?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_test_hook(&self, owner: &str, repo: &str, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/hooks/{id}/tests?{}", configuration.base_path, query_string, owner=owner, repo=repo, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn repo_tracked_times(&self, owner: &str, repo: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/times?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_update_file(&self, owner: &str, repo: &str, filepath: &str, body: ::models::UpdateFileOptions) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/contents/{filepath}?{}", configuration.base_path, query_string, owner=owner, repo=repo, filepath=filepath); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::FileResponse, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn repo_update_topics(&self, owner: &str, repo: &str, body: ::models::RepoTopicOptions) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/topics?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn topic_search(&self, q: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("q", &q.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/topics/search?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_check_subscription(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/subscription?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::WatchInfo, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_delete_subscription(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/subscription?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_put_subscription(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/subscription?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::WatchInfo, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + +} diff --git a/src/apis/user_api.rs b/src/apis/user_api.rs new file mode 100644 index 0000000..4ac6d3e --- /dev/null +++ b/src/apis/user_api.rs @@ -0,0 +1,4571 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::borrow::Cow; +use std::collections::HashMap; + +use hyper; +use serde_json; +use futures; +use futures::{Future, Stream}; + +use hyper::header::UserAgent; + +use super::{Error, configuration}; + +pub struct UserApiClient { + configuration: Rc>, +} + +impl UserApiClient { + pub fn new(configuration: Rc>) -> UserApiClient { + UserApiClient { + configuration: configuration, + } + } +} + +pub trait UserApi { + fn create_current_user_repo(&self, body: ::models::CreateRepoOption) -> Box>>; + fn user_add_email(&self, body: ::models::CreateEmailOption) -> Box, Error = Error>>; + fn user_check_following(&self, follower: &str, followee: &str) -> Box>>; + fn user_create_token(&self, username: &str, access_token: ::models::AccessToken) -> Box>>; + fn user_current_check_following(&self, username: &str) -> Box>>; + fn user_current_check_starring(&self, owner: &str, repo: &str) -> Box>>; + fn user_current_delete_follow(&self, username: &str) -> Box>>; + fn user_current_delete_gpg_key(&self, id: i64) -> Box>>; + fn user_current_delete_key(&self, id: i64) -> Box>>; + fn user_current_delete_star(&self, owner: &str, repo: &str) -> Box>>; + fn user_current_get_gpg_key(&self, id: i64) -> Box>>; + fn user_current_get_key(&self, id: i64) -> Box>>; + fn user_current_list_followers(&self, ) -> Box, Error = Error>>; + fn user_current_list_following(&self, ) -> Box, Error = Error>>; + fn user_current_list_gpg_keys(&self, ) -> Box, Error = Error>>; + fn user_current_list_keys(&self, fingerprint: &str) -> Box, Error = Error>>; + fn user_current_list_repos(&self, ) -> Box, Error = Error>>; + fn user_current_list_starred(&self, ) -> Box, Error = Error>>; + fn user_current_list_subscriptions(&self, ) -> Box, Error = Error>>; + fn user_current_post_gpg_key(&self, form: ::models::CreateGpgKeyOption) -> Box>>; + fn user_current_post_key(&self, body: ::models::CreateKeyOption) -> Box>>; + fn user_current_put_follow(&self, username: &str) -> Box>>; + fn user_current_put_star(&self, owner: &str, repo: &str) -> Box>>; + fn user_current_tracked_times(&self, ) -> Box, Error = Error>>; + fn user_delete_access_token(&self, username: &str, token: i64) -> Box>>; + fn user_delete_email(&self, body: ::models::DeleteEmailOption) -> Box>>; + fn user_get(&self, username: &str) -> Box>>; + fn user_get_current(&self, ) -> Box>>; + fn user_get_heatmap_data(&self, username: &str) -> Box, Error = Error>>; + fn user_get_stop_watches(&self, ) -> Box, Error = Error>>; + fn user_get_tokens(&self, username: &str) -> Box, Error = Error>>; + fn user_list_emails(&self, ) -> Box, Error = Error>>; + fn user_list_followers(&self, username: &str) -> Box, Error = Error>>; + fn user_list_following(&self, username: &str) -> Box, Error = Error>>; + fn user_list_gpg_keys(&self, username: &str) -> Box, Error = Error>>; + fn user_list_keys(&self, username: &str, fingerprint: &str) -> Box, Error = Error>>; + fn user_list_repos(&self, username: &str) -> Box, Error = Error>>; + fn user_list_starred(&self, username: &str) -> Box, Error = Error>>; + fn user_list_subscriptions(&self, username: &str) -> Box, Error = Error>>; + fn user_list_teams(&self, ) -> Box, Error = Error>>; + fn user_search(&self, q: &str, uid: i64, limit: i32) -> Box>>; + fn user_tracked_times(&self, owner: &str, repo: &str, user: &str) -> Box, Error = Error>>; +} + + +implUserApi for UserApiClient { + fn create_current_user_repo(&self, body: ::models::CreateRepoOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/repos?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::Repository, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_add_email(&self, body: ::models::CreateEmailOption) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/emails?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_check_following(&self, follower: &str, followee: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{follower}/following/{followee}?{}", configuration.base_path, query_string, follower=follower, followee=followee); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_create_token(&self, username: &str, access_token: ::models::AccessToken) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/tokens?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&access_token).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_check_following(&self, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/following/{username}?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_check_starring(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/starred/{owner}/{repo}?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_delete_follow(&self, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/following/{username}?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_delete_gpg_key(&self, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/gpg_keys/{id}?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_delete_key(&self, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/keys/{id}?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_delete_star(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/starred/{owner}/{repo}?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_get_gpg_key(&self, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/gpg_keys/{id}?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::GpgKey, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_get_key(&self, id: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/keys/{id}?{}", configuration.base_path, query_string, id=id); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::PublicKey, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_list_followers(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/followers?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_list_following(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/following?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_list_gpg_keys(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/gpg_keys?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_list_keys(&self, fingerprint: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("fingerprint", &fingerprint.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/keys?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_list_repos(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/repos?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_list_starred(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/starred?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_list_subscriptions(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/subscriptions?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_post_gpg_key(&self, form: ::models::CreateGpgKeyOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/gpg_keys?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&form).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::GpgKey, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_post_key(&self, body: ::models::CreateKeyOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Post; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/keys?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::PublicKey, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_current_put_follow(&self, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/following/{username}?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_put_star(&self, owner: &str, repo: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Put; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/starred/{owner}/{repo}?{}", configuration.base_path, query_string, owner=owner, repo=repo); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_current_tracked_times(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/times?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_delete_access_token(&self, username: &str, token: i64) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/tokens/{token}?{}", configuration.base_path, query_string, username=username, token=token); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_delete_email(&self, body: ::models::DeleteEmailOption) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Delete; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/emails?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + let serialized = serde_json::to_string(&body).unwrap(); + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); + req.set_body(serialized); + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|_| futures::future::ok(())) + ) + } + + fn user_get(&self, username: &str) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::User, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_get_current(&self, ) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::User, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_get_heatmap_data(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/heatmap?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_get_stop_watches(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/stopwatches?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_get_tokens(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/tokens?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_emails(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/emails?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_followers(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/followers?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_following(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/following?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_gpg_keys(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/gpg_keys?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_keys(&self, username: &str, fingerprint: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("fingerprint", &fingerprint.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/keys?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_repos(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/repos?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_starred(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/starred?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_subscriptions(&self, username: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/{username}/subscriptions?{}", configuration.base_path, query_string, username=username); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_list_teams(&self, ) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/user/teams?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_search(&self, q: &str, uid: i64, limit: i32) -> Box>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + query.append_pair("q", &q.to_string()); + query.append_pair("uid", &uid.to_string()); + query.append_pair("limit", &limit.to_string()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/users/search?{}", configuration.base_path, query_string); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result<::models::InlineResponse2001, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + + fn user_tracked_times(&self, owner: &str, repo: &str, user: &str) -> Box, Error = Error>> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + + let mut auth_headers = HashMap::::new(); + let mut auth_query = HashMap::::new(); + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("access_token".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Authorization".to_owned(), val); + }; + if let Some(ref auth_conf) = configuration.basic_auth { + let auth = hyper::header::Authorization( + hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + } + ); + auth_headers.insert("Authorization".to_owned(), auth.to_string()); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_headers.insert("Sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("sudo".to_owned(), val); + }; + if let Some(ref apikey) = configuration.api_key { + let key = apikey.key.clone(); + let val = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + auth_query.insert("token".to_owned(), val); + }; + let method = hyper::Method::Get; + + let query_string = { + let mut query = ::url::form_urlencoded::Serializer::new(String::new()); + for (key, val) in &auth_query { + query.append_pair(key, val); + } + query.finish() + }; + let uri_str = format!("{}/repos/{owner}/{repo}/times/{user}?{}", configuration.base_path, query_string, owner=owner, repo=repo, user=user); + + // TODO(farcaller): handle error + // if let Err(e) = uri { + // return Box::new(futures::future::err(e)); + // } + let mut uri: hyper::Uri = uri_str.parse().unwrap(); + + let mut req = hyper::Request::new(method, uri); + + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + + for (key, val) in auth_headers { + req.headers_mut().set_raw(key, val); + } + + + // send request + Box::new( + configuration.client.request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) + .and_then(|body| { + let parsed: Result, _> = serde_json::from_slice(&body); + parsed.map_err(|e| Error::from(e)) + }) + ) + } + +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..b51fea8 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,11 @@ +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +extern crate futures; +extern crate url; + +pub mod apis; +pub mod models; diff --git a/src/models/access_token.rs b/src/models/access_token.rs new file mode 100644 index 0000000..b096bc7 --- /dev/null +++ b/src/models/access_token.rs @@ -0,0 +1,45 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AccessToken { + #[serde(rename = "name")] + name: String +} + +impl AccessToken { + pub fn new(name: String) -> AccessToken { + AccessToken { + name: name + } + } + + pub fn set_name(&mut self, name: String) { + self.name = name; + } + + pub fn with_name(mut self, name: String) -> AccessToken { + self.name = name; + self + } + + pub fn name(&self) -> &String { + &self.name + } + + +} + + + diff --git a/src/models/add_collaborator_option.rs b/src/models/add_collaborator_option.rs new file mode 100644 index 0000000..27fa7ce --- /dev/null +++ b/src/models/add_collaborator_option.rs @@ -0,0 +1,50 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// AddCollaboratorOption : AddCollaboratorOption options when adding a user as a collaborator of a repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AddCollaboratorOption { + #[serde(rename = "permission")] + permission: Option +} + +impl AddCollaboratorOption { + /// AddCollaboratorOption options when adding a user as a collaborator of a repository + pub fn new() -> AddCollaboratorOption { + AddCollaboratorOption { + permission: None + } + } + + pub fn set_permission(&mut self, permission: String) { + self.permission = Some(permission); + } + + pub fn with_permission(mut self, permission: String) -> AddCollaboratorOption { + self.permission = Some(permission); + self + } + + pub fn permission(&self) -> Option<&String> { + self.permission.as_ref() + } + + pub fn reset_permission(&mut self) { + self.permission = None; + } + +} + + + diff --git a/src/models/add_time_option.rs b/src/models/add_time_option.rs new file mode 100644 index 0000000..5f310b6 --- /dev/null +++ b/src/models/add_time_option.rs @@ -0,0 +1,89 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// AddTimeOption : AddTimeOption options for adding time to an issue + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AddTimeOption { + #[serde(rename = "created")] + created: Option, + /// time in seconds + #[serde(rename = "time")] + time: i64, + /// User who spent the time (optional) + #[serde(rename = "user_name")] + user_name: Option +} + +impl AddTimeOption { + /// AddTimeOption options for adding time to an issue + pub fn new(time: i64) -> AddTimeOption { + AddTimeOption { + created: None, + time: time, + user_name: None + } + } + + pub fn set_created(&mut self, created: String) { + self.created = Some(created); + } + + pub fn with_created(mut self, created: String) -> AddTimeOption { + self.created = Some(created); + self + } + + pub fn created(&self) -> Option<&String> { + self.created.as_ref() + } + + pub fn reset_created(&mut self) { + self.created = None; + } + + pub fn set_time(&mut self, time: i64) { + self.time = time; + } + + pub fn with_time(mut self, time: i64) -> AddTimeOption { + self.time = time; + self + } + + pub fn time(&self) -> &i64 { + &self.time + } + + + pub fn set_user_name(&mut self, user_name: String) { + self.user_name = Some(user_name); + } + + pub fn with_user_name(mut self, user_name: String) -> AddTimeOption { + self.user_name = Some(user_name); + self + } + + pub fn user_name(&self) -> Option<&String> { + self.user_name.as_ref() + } + + pub fn reset_user_name(&mut self) { + self.user_name = None; + } + +} + + + diff --git a/src/models/annotated_tag.rs b/src/models/annotated_tag.rs new file mode 100644 index 0000000..c921771 --- /dev/null +++ b/src/models/annotated_tag.rs @@ -0,0 +1,170 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// AnnotatedTag : AnnotatedTag represents an annotated tag + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnnotatedTag { + #[serde(rename = "message")] + message: Option, + #[serde(rename = "object")] + object: Option<::models::AnnotatedTagObject>, + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "tag")] + tag: Option, + #[serde(rename = "tagger")] + tagger: Option<::models::CommitUser>, + #[serde(rename = "url")] + url: Option, + #[serde(rename = "verification")] + verification: Option<::models::PayloadCommitVerification> +} + +impl AnnotatedTag { + /// AnnotatedTag represents an annotated tag + pub fn new() -> AnnotatedTag { + AnnotatedTag { + message: None, + object: None, + sha: None, + tag: None, + tagger: None, + url: None, + verification: None + } + } + + pub fn set_message(&mut self, message: String) { + self.message = Some(message); + } + + pub fn with_message(mut self, message: String) -> AnnotatedTag { + self.message = Some(message); + self + } + + pub fn message(&self) -> Option<&String> { + self.message.as_ref() + } + + pub fn reset_message(&mut self) { + self.message = None; + } + + pub fn set_object(&mut self, object: ::models::AnnotatedTagObject) { + self.object = Some(object); + } + + pub fn with_object(mut self, object: ::models::AnnotatedTagObject) -> AnnotatedTag { + self.object = Some(object); + self + } + + pub fn object(&self) -> Option<&::models::AnnotatedTagObject> { + self.object.as_ref() + } + + pub fn reset_object(&mut self) { + self.object = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> AnnotatedTag { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set_tag(&mut self, tag: String) { + self.tag = Some(tag); + } + + pub fn with_tag(mut self, tag: String) -> AnnotatedTag { + self.tag = Some(tag); + self + } + + pub fn tag(&self) -> Option<&String> { + self.tag.as_ref() + } + + pub fn reset_tag(&mut self) { + self.tag = None; + } + + pub fn set_tagger(&mut self, tagger: ::models::CommitUser) { + self.tagger = Some(tagger); + } + + pub fn with_tagger(mut self, tagger: ::models::CommitUser) -> AnnotatedTag { + self.tagger = Some(tagger); + self + } + + pub fn tagger(&self) -> Option<&::models::CommitUser> { + self.tagger.as_ref() + } + + pub fn reset_tagger(&mut self) { + self.tagger = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> AnnotatedTag { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + + pub fn set_verification(&mut self, verification: ::models::PayloadCommitVerification) { + self.verification = Some(verification); + } + + pub fn with_verification(mut self, verification: ::models::PayloadCommitVerification) -> AnnotatedTag { + self.verification = Some(verification); + self + } + + pub fn verification(&self) -> Option<&::models::PayloadCommitVerification> { + self.verification.as_ref() + } + + pub fn reset_verification(&mut self) { + self.verification = None; + } + +} + + + diff --git a/src/models/annotated_tag_object.rs b/src/models/annotated_tag_object.rs new file mode 100644 index 0000000..fb8aa95 --- /dev/null +++ b/src/models/annotated_tag_object.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// AnnotatedTagObject : AnnotatedTagObject contains meta information of the tag object + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnnotatedTagObject { + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "type")] + _type: Option, + #[serde(rename = "url")] + url: Option +} + +impl AnnotatedTagObject { + /// AnnotatedTagObject contains meta information of the tag object + pub fn new() -> AnnotatedTagObject { + AnnotatedTagObject { + sha: None, + _type: None, + url: None + } + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> AnnotatedTagObject { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set__type(&mut self, _type: String) { + self._type = Some(_type); + } + + pub fn with__type(mut self, _type: String) -> AnnotatedTagObject { + self._type = Some(_type); + self + } + + pub fn _type(&self) -> Option<&String> { + self._type.as_ref() + } + + pub fn reset__type(&mut self) { + self._type = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> AnnotatedTagObject { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/api_error.rs b/src/models/api_error.rs new file mode 100644 index 0000000..9d4f470 --- /dev/null +++ b/src/models/api_error.rs @@ -0,0 +1,70 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// ApiError : APIError is an api error with a message + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct ApiError { + #[serde(rename = "message")] + message: Option, + #[serde(rename = "url")] + url: Option +} + +impl ApiError { + /// APIError is an api error with a message + pub fn new() -> ApiError { + ApiError { + message: None, + url: None + } + } + + pub fn set_message(&mut self, message: String) { + self.message = Some(message); + } + + pub fn with_message(mut self, message: String) -> ApiError { + self.message = Some(message); + self + } + + pub fn message(&self) -> Option<&String> { + self.message.as_ref() + } + + pub fn reset_message(&mut self) { + self.message = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> ApiError { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/attachment.rs b/src/models/attachment.rs new file mode 100644 index 0000000..2c72882 --- /dev/null +++ b/src/models/attachment.rs @@ -0,0 +1,170 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Attachment : Attachment a generic attachment + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Attachment { + #[serde(rename = "browser_download_url")] + browser_download_url: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "download_count")] + download_count: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "size")] + size: Option, + #[serde(rename = "uuid")] + uuid: Option +} + +impl Attachment { + /// Attachment a generic attachment + pub fn new() -> Attachment { + Attachment { + browser_download_url: None, + created_at: None, + download_count: None, + id: None, + name: None, + size: None, + uuid: None + } + } + + pub fn set_browser_download_url(&mut self, browser_download_url: String) { + self.browser_download_url = Some(browser_download_url); + } + + pub fn with_browser_download_url(mut self, browser_download_url: String) -> Attachment { + self.browser_download_url = Some(browser_download_url); + self + } + + pub fn browser_download_url(&self) -> Option<&String> { + self.browser_download_url.as_ref() + } + + pub fn reset_browser_download_url(&mut self) { + self.browser_download_url = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> Attachment { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_download_count(&mut self, download_count: i64) { + self.download_count = Some(download_count); + } + + pub fn with_download_count(mut self, download_count: i64) -> Attachment { + self.download_count = Some(download_count); + self + } + + pub fn download_count(&self) -> Option<&i64> { + self.download_count.as_ref() + } + + pub fn reset_download_count(&mut self) { + self.download_count = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Attachment { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> Attachment { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_size(&mut self, size: i64) { + self.size = Some(size); + } + + pub fn with_size(mut self, size: i64) -> Attachment { + self.size = Some(size); + self + } + + pub fn size(&self) -> Option<&i64> { + self.size.as_ref() + } + + pub fn reset_size(&mut self) { + self.size = None; + } + + pub fn set_uuid(&mut self, uuid: String) { + self.uuid = Some(uuid); + } + + pub fn with_uuid(mut self, uuid: String) -> Attachment { + self.uuid = Some(uuid); + self + } + + pub fn uuid(&self) -> Option<&String> { + self.uuid.as_ref() + } + + pub fn reset_uuid(&mut self) { + self.uuid = None; + } + +} + + + diff --git a/src/models/branch.rs b/src/models/branch.rs new file mode 100644 index 0000000..b046494 --- /dev/null +++ b/src/models/branch.rs @@ -0,0 +1,190 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Branch : Branch represents a repository branch + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Branch { + #[serde(rename = "commit")] + commit: Option<::models::PayloadCommit>, + #[serde(rename = "enable_status_check")] + enable_status_check: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "protected")] + protected: Option, + #[serde(rename = "required_approvals")] + required_approvals: Option, + #[serde(rename = "status_check_contexts")] + status_check_contexts: Option>, + #[serde(rename = "user_can_merge")] + user_can_merge: Option, + #[serde(rename = "user_can_push")] + user_can_push: Option +} + +impl Branch { + /// Branch represents a repository branch + pub fn new() -> Branch { + Branch { + commit: None, + enable_status_check: None, + name: None, + protected: None, + required_approvals: None, + status_check_contexts: None, + user_can_merge: None, + user_can_push: None + } + } + + pub fn set_commit(&mut self, commit: ::models::PayloadCommit) { + self.commit = Some(commit); + } + + pub fn with_commit(mut self, commit: ::models::PayloadCommit) -> Branch { + self.commit = Some(commit); + self + } + + pub fn commit(&self) -> Option<&::models::PayloadCommit> { + self.commit.as_ref() + } + + pub fn reset_commit(&mut self) { + self.commit = None; + } + + pub fn set_enable_status_check(&mut self, enable_status_check: bool) { + self.enable_status_check = Some(enable_status_check); + } + + pub fn with_enable_status_check(mut self, enable_status_check: bool) -> Branch { + self.enable_status_check = Some(enable_status_check); + self + } + + pub fn enable_status_check(&self) -> Option<&bool> { + self.enable_status_check.as_ref() + } + + pub fn reset_enable_status_check(&mut self) { + self.enable_status_check = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> Branch { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_protected(&mut self, protected: bool) { + self.protected = Some(protected); + } + + pub fn with_protected(mut self, protected: bool) -> Branch { + self.protected = Some(protected); + self + } + + pub fn protected(&self) -> Option<&bool> { + self.protected.as_ref() + } + + pub fn reset_protected(&mut self) { + self.protected = None; + } + + pub fn set_required_approvals(&mut self, required_approvals: i64) { + self.required_approvals = Some(required_approvals); + } + + pub fn with_required_approvals(mut self, required_approvals: i64) -> Branch { + self.required_approvals = Some(required_approvals); + self + } + + pub fn required_approvals(&self) -> Option<&i64> { + self.required_approvals.as_ref() + } + + pub fn reset_required_approvals(&mut self) { + self.required_approvals = None; + } + + pub fn set_status_check_contexts(&mut self, status_check_contexts: Vec) { + self.status_check_contexts = Some(status_check_contexts); + } + + pub fn with_status_check_contexts(mut self, status_check_contexts: Vec) -> Branch { + self.status_check_contexts = Some(status_check_contexts); + self + } + + pub fn status_check_contexts(&self) -> Option<&Vec> { + self.status_check_contexts.as_ref() + } + + pub fn reset_status_check_contexts(&mut self) { + self.status_check_contexts = None; + } + + pub fn set_user_can_merge(&mut self, user_can_merge: bool) { + self.user_can_merge = Some(user_can_merge); + } + + pub fn with_user_can_merge(mut self, user_can_merge: bool) -> Branch { + self.user_can_merge = Some(user_can_merge); + self + } + + pub fn user_can_merge(&self) -> Option<&bool> { + self.user_can_merge.as_ref() + } + + pub fn reset_user_can_merge(&mut self) { + self.user_can_merge = None; + } + + pub fn set_user_can_push(&mut self, user_can_push: bool) { + self.user_can_push = Some(user_can_push); + } + + pub fn with_user_can_push(mut self, user_can_push: bool) -> Branch { + self.user_can_push = Some(user_can_push); + self + } + + pub fn user_can_push(&self) -> Option<&bool> { + self.user_can_push.as_ref() + } + + pub fn reset_user_can_push(&mut self) { + self.user_can_push = None; + } + +} + + + diff --git a/src/models/comment.rs b/src/models/comment.rs new file mode 100644 index 0000000..3761107 --- /dev/null +++ b/src/models/comment.rs @@ -0,0 +1,230 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Comment : Comment represents a comment on a commit or issue + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Comment { + #[serde(rename = "body")] + body: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "html_url")] + html_url: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "issue_url")] + issue_url: Option, + #[serde(rename = "original_author")] + original_author: Option, + #[serde(rename = "original_author_id")] + original_author_id: Option, + #[serde(rename = "pull_request_url")] + pull_request_url: Option, + #[serde(rename = "updated_at")] + updated_at: Option, + #[serde(rename = "user")] + user: Option<::models::User> +} + +impl Comment { + /// Comment represents a comment on a commit or issue + pub fn new() -> Comment { + Comment { + body: None, + created_at: None, + html_url: None, + id: None, + issue_url: None, + original_author: None, + original_author_id: None, + pull_request_url: None, + updated_at: None, + user: None + } + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> Comment { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> Comment { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_html_url(&mut self, html_url: String) { + self.html_url = Some(html_url); + } + + pub fn with_html_url(mut self, html_url: String) -> Comment { + self.html_url = Some(html_url); + self + } + + pub fn html_url(&self) -> Option<&String> { + self.html_url.as_ref() + } + + pub fn reset_html_url(&mut self) { + self.html_url = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Comment { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_issue_url(&mut self, issue_url: String) { + self.issue_url = Some(issue_url); + } + + pub fn with_issue_url(mut self, issue_url: String) -> Comment { + self.issue_url = Some(issue_url); + self + } + + pub fn issue_url(&self) -> Option<&String> { + self.issue_url.as_ref() + } + + pub fn reset_issue_url(&mut self) { + self.issue_url = None; + } + + pub fn set_original_author(&mut self, original_author: String) { + self.original_author = Some(original_author); + } + + pub fn with_original_author(mut self, original_author: String) -> Comment { + self.original_author = Some(original_author); + self + } + + pub fn original_author(&self) -> Option<&String> { + self.original_author.as_ref() + } + + pub fn reset_original_author(&mut self) { + self.original_author = None; + } + + pub fn set_original_author_id(&mut self, original_author_id: i64) { + self.original_author_id = Some(original_author_id); + } + + pub fn with_original_author_id(mut self, original_author_id: i64) -> Comment { + self.original_author_id = Some(original_author_id); + self + } + + pub fn original_author_id(&self) -> Option<&i64> { + self.original_author_id.as_ref() + } + + pub fn reset_original_author_id(&mut self) { + self.original_author_id = None; + } + + pub fn set_pull_request_url(&mut self, pull_request_url: String) { + self.pull_request_url = Some(pull_request_url); + } + + pub fn with_pull_request_url(mut self, pull_request_url: String) -> Comment { + self.pull_request_url = Some(pull_request_url); + self + } + + pub fn pull_request_url(&self) -> Option<&String> { + self.pull_request_url.as_ref() + } + + pub fn reset_pull_request_url(&mut self) { + self.pull_request_url = None; + } + + pub fn set_updated_at(&mut self, updated_at: String) { + self.updated_at = Some(updated_at); + } + + pub fn with_updated_at(mut self, updated_at: String) -> Comment { + self.updated_at = Some(updated_at); + self + } + + pub fn updated_at(&self) -> Option<&String> { + self.updated_at.as_ref() + } + + pub fn reset_updated_at(&mut self) { + self.updated_at = None; + } + + pub fn set_user(&mut self, user: ::models::User) { + self.user = Some(user); + } + + pub fn with_user(mut self, user: ::models::User) -> Comment { + self.user = Some(user); + self + } + + pub fn user(&self) -> Option<&::models::User> { + self.user.as_ref() + } + + pub fn reset_user(&mut self) { + self.user = None; + } + +} + + + diff --git a/src/models/commit.rs b/src/models/commit.rs new file mode 100644 index 0000000..b55b79e --- /dev/null +++ b/src/models/commit.rs @@ -0,0 +1,168 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Commit { + #[serde(rename = "author")] + author: Option<::models::User>, + #[serde(rename = "commit")] + commit: Option<::models::RepoCommit>, + #[serde(rename = "committer")] + committer: Option<::models::User>, + #[serde(rename = "html_url")] + html_url: Option, + #[serde(rename = "parents")] + parents: Option>, + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "url")] + url: Option +} + +impl Commit { + pub fn new() -> Commit { + Commit { + author: None, + commit: None, + committer: None, + html_url: None, + parents: None, + sha: None, + url: None + } + } + + pub fn set_author(&mut self, author: ::models::User) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: ::models::User) -> Commit { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&::models::User> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_commit(&mut self, commit: ::models::RepoCommit) { + self.commit = Some(commit); + } + + pub fn with_commit(mut self, commit: ::models::RepoCommit) -> Commit { + self.commit = Some(commit); + self + } + + pub fn commit(&self) -> Option<&::models::RepoCommit> { + self.commit.as_ref() + } + + pub fn reset_commit(&mut self) { + self.commit = None; + } + + pub fn set_committer(&mut self, committer: ::models::User) { + self.committer = Some(committer); + } + + pub fn with_committer(mut self, committer: ::models::User) -> Commit { + self.committer = Some(committer); + self + } + + pub fn committer(&self) -> Option<&::models::User> { + self.committer.as_ref() + } + + pub fn reset_committer(&mut self) { + self.committer = None; + } + + pub fn set_html_url(&mut self, html_url: String) { + self.html_url = Some(html_url); + } + + pub fn with_html_url(mut self, html_url: String) -> Commit { + self.html_url = Some(html_url); + self + } + + pub fn html_url(&self) -> Option<&String> { + self.html_url.as_ref() + } + + pub fn reset_html_url(&mut self) { + self.html_url = None; + } + + pub fn set_parents(&mut self, parents: Vec<::models::CommitMeta>) { + self.parents = Some(parents); + } + + pub fn with_parents(mut self, parents: Vec<::models::CommitMeta>) -> Commit { + self.parents = Some(parents); + self + } + + pub fn parents(&self) -> Option<&Vec<::models::CommitMeta>> { + self.parents.as_ref() + } + + pub fn reset_parents(&mut self) { + self.parents = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> Commit { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> Commit { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/commit_date_options.rs b/src/models/commit_date_options.rs new file mode 100644 index 0000000..db5946b --- /dev/null +++ b/src/models/commit_date_options.rs @@ -0,0 +1,70 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CommitDateOptions : CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CommitDateOptions { + #[serde(rename = "author")] + author: Option, + #[serde(rename = "committer")] + committer: Option +} + +impl CommitDateOptions { + /// CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE + pub fn new() -> CommitDateOptions { + CommitDateOptions { + author: None, + committer: None + } + } + + pub fn set_author(&mut self, author: String) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: String) -> CommitDateOptions { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&String> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_committer(&mut self, committer: String) { + self.committer = Some(committer); + } + + pub fn with_committer(mut self, committer: String) -> CommitDateOptions { + self.committer = Some(committer); + self + } + + pub fn committer(&self) -> Option<&String> { + self.committer.as_ref() + } + + pub fn reset_committer(&mut self) { + self.committer = None; + } + +} + + + diff --git a/src/models/commit_meta.rs b/src/models/commit_meta.rs new file mode 100644 index 0000000..0fa3347 --- /dev/null +++ b/src/models/commit_meta.rs @@ -0,0 +1,68 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CommitMeta { + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "url")] + url: Option +} + +impl CommitMeta { + pub fn new() -> CommitMeta { + CommitMeta { + sha: None, + url: None + } + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> CommitMeta { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> CommitMeta { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/commit_user.rs b/src/models/commit_user.rs new file mode 100644 index 0000000..ec9d87e --- /dev/null +++ b/src/models/commit_user.rs @@ -0,0 +1,88 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CommitUser { + #[serde(rename = "date")] + date: Option, + #[serde(rename = "email")] + email: Option, + #[serde(rename = "name")] + name: Option +} + +impl CommitUser { + pub fn new() -> CommitUser { + CommitUser { + date: None, + email: None, + name: None + } + } + + pub fn set_date(&mut self, date: String) { + self.date = Some(date); + } + + pub fn with_date(mut self, date: String) -> CommitUser { + self.date = Some(date); + self + } + + pub fn date(&self) -> Option<&String> { + self.date.as_ref() + } + + pub fn reset_date(&mut self) { + self.date = None; + } + + pub fn set_email(&mut self, email: String) { + self.email = Some(email); + } + + pub fn with_email(mut self, email: String) -> CommitUser { + self.email = Some(email); + self + } + + pub fn email(&self) -> Option<&String> { + self.email.as_ref() + } + + pub fn reset_email(&mut self) { + self.email = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> CommitUser { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + +} + + + diff --git a/src/models/contents_response.rs b/src/models/contents_response.rs new file mode 100644 index 0000000..0a38646 --- /dev/null +++ b/src/models/contents_response.rs @@ -0,0 +1,315 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// ContentsResponse : ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct ContentsResponse { + #[serde(rename = "_links")] + _links: Option<::models::FileLinksResponse>, + /// `content` is populated when `type` is `file`, otherwise null + #[serde(rename = "content")] + content: Option, + #[serde(rename = "download_url")] + download_url: Option, + /// `encoding` is populated when `type` is `file`, otherwise null + #[serde(rename = "encoding")] + encoding: Option, + #[serde(rename = "git_url")] + git_url: Option, + #[serde(rename = "html_url")] + html_url: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "path")] + path: Option, + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "size")] + size: Option, + /// `submodule_git_url` is populated when `type` is `submodule`, otherwise null + #[serde(rename = "submodule_git_url")] + submodule_git_url: Option, + /// `target` is populated when `type` is `symlink`, otherwise null + #[serde(rename = "target")] + target: Option, + /// `type` will be `file`, `dir`, `symlink`, or `submodule` + #[serde(rename = "type")] + _type: Option, + #[serde(rename = "url")] + url: Option +} + +impl ContentsResponse { + /// ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content + pub fn new() -> ContentsResponse { + ContentsResponse { + _links: None, + content: None, + download_url: None, + encoding: None, + git_url: None, + html_url: None, + name: None, + path: None, + sha: None, + size: None, + submodule_git_url: None, + target: None, + _type: None, + url: None + } + } + + pub fn set__links(&mut self, _links: ::models::FileLinksResponse) { + self._links = Some(_links); + } + + pub fn with__links(mut self, _links: ::models::FileLinksResponse) -> ContentsResponse { + self._links = Some(_links); + self + } + + pub fn _links(&self) -> Option<&::models::FileLinksResponse> { + self._links.as_ref() + } + + pub fn reset__links(&mut self) { + self._links = None; + } + + pub fn set_content(&mut self, content: String) { + self.content = Some(content); + } + + pub fn with_content(mut self, content: String) -> ContentsResponse { + self.content = Some(content); + self + } + + pub fn content(&self) -> Option<&String> { + self.content.as_ref() + } + + pub fn reset_content(&mut self) { + self.content = None; + } + + pub fn set_download_url(&mut self, download_url: String) { + self.download_url = Some(download_url); + } + + pub fn with_download_url(mut self, download_url: String) -> ContentsResponse { + self.download_url = Some(download_url); + self + } + + pub fn download_url(&self) -> Option<&String> { + self.download_url.as_ref() + } + + pub fn reset_download_url(&mut self) { + self.download_url = None; + } + + pub fn set_encoding(&mut self, encoding: String) { + self.encoding = Some(encoding); + } + + pub fn with_encoding(mut self, encoding: String) -> ContentsResponse { + self.encoding = Some(encoding); + self + } + + pub fn encoding(&self) -> Option<&String> { + self.encoding.as_ref() + } + + pub fn reset_encoding(&mut self) { + self.encoding = None; + } + + pub fn set_git_url(&mut self, git_url: String) { + self.git_url = Some(git_url); + } + + pub fn with_git_url(mut self, git_url: String) -> ContentsResponse { + self.git_url = Some(git_url); + self + } + + pub fn git_url(&self) -> Option<&String> { + self.git_url.as_ref() + } + + pub fn reset_git_url(&mut self) { + self.git_url = None; + } + + pub fn set_html_url(&mut self, html_url: String) { + self.html_url = Some(html_url); + } + + pub fn with_html_url(mut self, html_url: String) -> ContentsResponse { + self.html_url = Some(html_url); + self + } + + pub fn html_url(&self) -> Option<&String> { + self.html_url.as_ref() + } + + pub fn reset_html_url(&mut self) { + self.html_url = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> ContentsResponse { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_path(&mut self, path: String) { + self.path = Some(path); + } + + pub fn with_path(mut self, path: String) -> ContentsResponse { + self.path = Some(path); + self + } + + pub fn path(&self) -> Option<&String> { + self.path.as_ref() + } + + pub fn reset_path(&mut self) { + self.path = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> ContentsResponse { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set_size(&mut self, size: i64) { + self.size = Some(size); + } + + pub fn with_size(mut self, size: i64) -> ContentsResponse { + self.size = Some(size); + self + } + + pub fn size(&self) -> Option<&i64> { + self.size.as_ref() + } + + pub fn reset_size(&mut self) { + self.size = None; + } + + pub fn set_submodule_git_url(&mut self, submodule_git_url: String) { + self.submodule_git_url = Some(submodule_git_url); + } + + pub fn with_submodule_git_url(mut self, submodule_git_url: String) -> ContentsResponse { + self.submodule_git_url = Some(submodule_git_url); + self + } + + pub fn submodule_git_url(&self) -> Option<&String> { + self.submodule_git_url.as_ref() + } + + pub fn reset_submodule_git_url(&mut self) { + self.submodule_git_url = None; + } + + pub fn set_target(&mut self, target: String) { + self.target = Some(target); + } + + pub fn with_target(mut self, target: String) -> ContentsResponse { + self.target = Some(target); + self + } + + pub fn target(&self) -> Option<&String> { + self.target.as_ref() + } + + pub fn reset_target(&mut self) { + self.target = None; + } + + pub fn set__type(&mut self, _type: String) { + self._type = Some(_type); + } + + pub fn with__type(mut self, _type: String) -> ContentsResponse { + self._type = Some(_type); + self + } + + pub fn _type(&self) -> Option<&String> { + self._type.as_ref() + } + + pub fn reset__type(&mut self) { + self._type = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> ContentsResponse { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/create_email_option.rs b/src/models/create_email_option.rs new file mode 100644 index 0000000..7401513 --- /dev/null +++ b/src/models/create_email_option.rs @@ -0,0 +1,51 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateEmailOption : CreateEmailOption options when creating email addresses + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateEmailOption { + /// email addresses to add + #[serde(rename = "emails")] + emails: Option> +} + +impl CreateEmailOption { + /// CreateEmailOption options when creating email addresses + pub fn new() -> CreateEmailOption { + CreateEmailOption { + emails: None + } + } + + pub fn set_emails(&mut self, emails: Vec) { + self.emails = Some(emails); + } + + pub fn with_emails(mut self, emails: Vec) -> CreateEmailOption { + self.emails = Some(emails); + self + } + + pub fn emails(&self) -> Option<&Vec> { + self.emails.as_ref() + } + + pub fn reset_emails(&mut self) { + self.emails = None; + } + +} + + + diff --git a/src/models/create_file_options.rs b/src/models/create_file_options.rs new file mode 100644 index 0000000..13bd704 --- /dev/null +++ b/src/models/create_file_options.rs @@ -0,0 +1,171 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateFileOptions : CreateFileOptions options for creating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateFileOptions { + #[serde(rename = "author")] + author: Option<::models::Identity>, + /// branch (optional) to base this file from. if not given, the default branch is used + #[serde(rename = "branch")] + branch: Option, + #[serde(rename = "committer")] + committer: Option<::models::Identity>, + /// content must be base64 encoded + #[serde(rename = "content")] + content: String, + #[serde(rename = "dates")] + dates: Option<::models::CommitDateOptions>, + /// message (optional) for the commit of this file. if not supplied, a default message will be used + #[serde(rename = "message")] + message: Option, + /// new_branch (optional) will make a new branch from `branch` before creating the file + #[serde(rename = "new_branch")] + new_branch: Option +} + +impl CreateFileOptions { + /// CreateFileOptions options for creating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + pub fn new(content: String) -> CreateFileOptions { + CreateFileOptions { + author: None, + branch: None, + committer: None, + content: content, + dates: None, + message: None, + new_branch: None + } + } + + pub fn set_author(&mut self, author: ::models::Identity) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: ::models::Identity) -> CreateFileOptions { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&::models::Identity> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_branch(&mut self, branch: String) { + self.branch = Some(branch); + } + + pub fn with_branch(mut self, branch: String) -> CreateFileOptions { + self.branch = Some(branch); + self + } + + pub fn branch(&self) -> Option<&String> { + self.branch.as_ref() + } + + pub fn reset_branch(&mut self) { + self.branch = None; + } + + pub fn set_committer(&mut self, committer: ::models::Identity) { + self.committer = Some(committer); + } + + pub fn with_committer(mut self, committer: ::models::Identity) -> CreateFileOptions { + self.committer = Some(committer); + self + } + + pub fn committer(&self) -> Option<&::models::Identity> { + self.committer.as_ref() + } + + pub fn reset_committer(&mut self) { + self.committer = None; + } + + pub fn set_content(&mut self, content: String) { + self.content = content; + } + + pub fn with_content(mut self, content: String) -> CreateFileOptions { + self.content = content; + self + } + + pub fn content(&self) -> &String { + &self.content + } + + + pub fn set_dates(&mut self, dates: ::models::CommitDateOptions) { + self.dates = Some(dates); + } + + pub fn with_dates(mut self, dates: ::models::CommitDateOptions) -> CreateFileOptions { + self.dates = Some(dates); + self + } + + pub fn dates(&self) -> Option<&::models::CommitDateOptions> { + self.dates.as_ref() + } + + pub fn reset_dates(&mut self) { + self.dates = None; + } + + pub fn set_message(&mut self, message: String) { + self.message = Some(message); + } + + pub fn with_message(mut self, message: String) -> CreateFileOptions { + self.message = Some(message); + self + } + + pub fn message(&self) -> Option<&String> { + self.message.as_ref() + } + + pub fn reset_message(&mut self) { + self.message = None; + } + + pub fn set_new_branch(&mut self, new_branch: String) { + self.new_branch = Some(new_branch); + } + + pub fn with_new_branch(mut self, new_branch: String) -> CreateFileOptions { + self.new_branch = Some(new_branch); + self + } + + pub fn new_branch(&self) -> Option<&String> { + self.new_branch.as_ref() + } + + pub fn reset_new_branch(&mut self) { + self.new_branch = None; + } + +} + + + diff --git a/src/models/create_fork_option.rs b/src/models/create_fork_option.rs new file mode 100644 index 0000000..c134940 --- /dev/null +++ b/src/models/create_fork_option.rs @@ -0,0 +1,51 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateForkOption : CreateForkOption options for creating a fork + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateForkOption { + /// organization name, if forking into an organization + #[serde(rename = "organization")] + organization: Option +} + +impl CreateForkOption { + /// CreateForkOption options for creating a fork + pub fn new() -> CreateForkOption { + CreateForkOption { + organization: None + } + } + + pub fn set_organization(&mut self, organization: String) { + self.organization = Some(organization); + } + + pub fn with_organization(mut self, organization: String) -> CreateForkOption { + self.organization = Some(organization); + self + } + + pub fn organization(&self) -> Option<&String> { + self.organization.as_ref() + } + + pub fn reset_organization(&mut self) { + self.organization = None; + } + +} + + + diff --git a/src/models/create_gpg_key_option.rs b/src/models/create_gpg_key_option.rs new file mode 100644 index 0000000..9efa1ff --- /dev/null +++ b/src/models/create_gpg_key_option.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateGpgKeyOption : CreateGPGKeyOption options create user GPG key + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateGpgKeyOption { + /// An armored GPG key to add + #[serde(rename = "armored_public_key")] + armored_public_key: String +} + +impl CreateGpgKeyOption { + /// CreateGPGKeyOption options create user GPG key + pub fn new(armored_public_key: String) -> CreateGpgKeyOption { + CreateGpgKeyOption { + armored_public_key: armored_public_key + } + } + + pub fn set_armored_public_key(&mut self, armored_public_key: String) { + self.armored_public_key = armored_public_key; + } + + pub fn with_armored_public_key(mut self, armored_public_key: String) -> CreateGpgKeyOption { + self.armored_public_key = armored_public_key; + self + } + + pub fn armored_public_key(&self) -> &String { + &self.armored_public_key + } + + +} + + + diff --git a/src/models/create_hook_option.rs b/src/models/create_hook_option.rs new file mode 100644 index 0000000..f992201 --- /dev/null +++ b/src/models/create_hook_option.rs @@ -0,0 +1,124 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateHookOption : CreateHookOption options when create a hook + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateHookOption { + #[serde(rename = "active")] + active: Option, + #[serde(rename = "branch_filter")] + branch_filter: Option, + #[serde(rename = "config")] + config: ::models::CreateHookOptionConfig, + #[serde(rename = "events")] + events: Option>, + #[serde(rename = "type")] + _type: String +} + +impl CreateHookOption { + /// CreateHookOption options when create a hook + pub fn new(config: ::models::CreateHookOptionConfig, _type: String) -> CreateHookOption { + CreateHookOption { + active: None, + branch_filter: None, + config: config, + events: None, + _type: _type + } + } + + pub fn set_active(&mut self, active: bool) { + self.active = Some(active); + } + + pub fn with_active(mut self, active: bool) -> CreateHookOption { + self.active = Some(active); + self + } + + pub fn active(&self) -> Option<&bool> { + self.active.as_ref() + } + + pub fn reset_active(&mut self) { + self.active = None; + } + + pub fn set_branch_filter(&mut self, branch_filter: String) { + self.branch_filter = Some(branch_filter); + } + + pub fn with_branch_filter(mut self, branch_filter: String) -> CreateHookOption { + self.branch_filter = Some(branch_filter); + self + } + + pub fn branch_filter(&self) -> Option<&String> { + self.branch_filter.as_ref() + } + + pub fn reset_branch_filter(&mut self) { + self.branch_filter = None; + } + + pub fn set_config(&mut self, config: ::models::CreateHookOptionConfig) { + self.config = config; + } + + pub fn with_config(mut self, config: ::models::CreateHookOptionConfig) -> CreateHookOption { + self.config = config; + self + } + + pub fn config(&self) -> &::models::CreateHookOptionConfig { + &self.config + } + + + pub fn set_events(&mut self, events: Vec) { + self.events = Some(events); + } + + pub fn with_events(mut self, events: Vec) -> CreateHookOption { + self.events = Some(events); + self + } + + pub fn events(&self) -> Option<&Vec> { + self.events.as_ref() + } + + pub fn reset_events(&mut self) { + self.events = None; + } + + pub fn set__type(&mut self, _type: String) { + self._type = _type; + } + + pub fn with__type(mut self, _type: String) -> CreateHookOption { + self._type = _type; + self + } + + pub fn _type(&self) -> &String { + &self._type + } + + +} + + + diff --git a/src/models/create_hook_option_config.rs b/src/models/create_hook_option_config.rs new file mode 100644 index 0000000..bf28e2c --- /dev/null +++ b/src/models/create_hook_option_config.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateHookOptionConfig : CreateHookOptionConfig has all config options in it required are \"content_type\" and \"url\" Required + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateHookOptionConfig { +} + +impl CreateHookOptionConfig { + /// CreateHookOptionConfig has all config options in it required are \"content_type\" and \"url\" Required + pub fn new() -> CreateHookOptionConfig { + CreateHookOptionConfig { + } + } + +} + + + diff --git a/src/models/create_issue_comment_option.rs b/src/models/create_issue_comment_option.rs new file mode 100644 index 0000000..35b3a5b --- /dev/null +++ b/src/models/create_issue_comment_option.rs @@ -0,0 +1,47 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateIssueCommentOption : CreateIssueCommentOption options for creating a comment on an issue + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateIssueCommentOption { + #[serde(rename = "body")] + body: String +} + +impl CreateIssueCommentOption { + /// CreateIssueCommentOption options for creating a comment on an issue + pub fn new(body: String) -> CreateIssueCommentOption { + CreateIssueCommentOption { + body: body + } + } + + pub fn set_body(&mut self, body: String) { + self.body = body; + } + + pub fn with_body(mut self, body: String) -> CreateIssueCommentOption { + self.body = body; + self + } + + pub fn body(&self) -> &String { + &self.body + } + + +} + + + diff --git a/src/models/create_issue_option.rs b/src/models/create_issue_option.rs new file mode 100644 index 0000000..5371b2d --- /dev/null +++ b/src/models/create_issue_option.rs @@ -0,0 +1,190 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateIssueOption : CreateIssueOption options to create one issue + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateIssueOption { + /// username of assignee + #[serde(rename = "assignee")] + assignee: Option, + #[serde(rename = "assignees")] + assignees: Option>, + #[serde(rename = "body")] + body: Option, + #[serde(rename = "closed")] + closed: Option, + #[serde(rename = "due_date")] + due_date: Option, + /// list of label ids + #[serde(rename = "labels")] + labels: Option>, + /// milestone id + #[serde(rename = "milestone")] + milestone: Option, + #[serde(rename = "title")] + title: String +} + +impl CreateIssueOption { + /// CreateIssueOption options to create one issue + pub fn new(title: String) -> CreateIssueOption { + CreateIssueOption { + assignee: None, + assignees: None, + body: None, + closed: None, + due_date: None, + labels: None, + milestone: None, + title: title + } + } + + pub fn set_assignee(&mut self, assignee: String) { + self.assignee = Some(assignee); + } + + pub fn with_assignee(mut self, assignee: String) -> CreateIssueOption { + self.assignee = Some(assignee); + self + } + + pub fn assignee(&self) -> Option<&String> { + self.assignee.as_ref() + } + + pub fn reset_assignee(&mut self) { + self.assignee = None; + } + + pub fn set_assignees(&mut self, assignees: Vec) { + self.assignees = Some(assignees); + } + + pub fn with_assignees(mut self, assignees: Vec) -> CreateIssueOption { + self.assignees = Some(assignees); + self + } + + pub fn assignees(&self) -> Option<&Vec> { + self.assignees.as_ref() + } + + pub fn reset_assignees(&mut self) { + self.assignees = None; + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> CreateIssueOption { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_closed(&mut self, closed: bool) { + self.closed = Some(closed); + } + + pub fn with_closed(mut self, closed: bool) -> CreateIssueOption { + self.closed = Some(closed); + self + } + + pub fn closed(&self) -> Option<&bool> { + self.closed.as_ref() + } + + pub fn reset_closed(&mut self) { + self.closed = None; + } + + pub fn set_due_date(&mut self, due_date: String) { + self.due_date = Some(due_date); + } + + pub fn with_due_date(mut self, due_date: String) -> CreateIssueOption { + self.due_date = Some(due_date); + self + } + + pub fn due_date(&self) -> Option<&String> { + self.due_date.as_ref() + } + + pub fn reset_due_date(&mut self) { + self.due_date = None; + } + + pub fn set_labels(&mut self, labels: Vec) { + self.labels = Some(labels); + } + + pub fn with_labels(mut self, labels: Vec) -> CreateIssueOption { + self.labels = Some(labels); + self + } + + pub fn labels(&self) -> Option<&Vec> { + self.labels.as_ref() + } + + pub fn reset_labels(&mut self) { + self.labels = None; + } + + pub fn set_milestone(&mut self, milestone: i64) { + self.milestone = Some(milestone); + } + + pub fn with_milestone(mut self, milestone: i64) -> CreateIssueOption { + self.milestone = Some(milestone); + self + } + + pub fn milestone(&self) -> Option<&i64> { + self.milestone.as_ref() + } + + pub fn reset_milestone(&mut self) { + self.milestone = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = title; + } + + pub fn with_title(mut self, title: String) -> CreateIssueOption { + self.title = title; + self + } + + pub fn title(&self) -> &String { + &self.title + } + + +} + + + diff --git a/src/models/create_key_option.rs b/src/models/create_key_option.rs new file mode 100644 index 0000000..0460c87 --- /dev/null +++ b/src/models/create_key_option.rs @@ -0,0 +1,87 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateKeyOption : CreateKeyOption options when creating a key + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateKeyOption { + /// An armored SSH key to add + #[serde(rename = "key")] + key: String, + /// Describe if the key has only read access or read/write + #[serde(rename = "read_only")] + read_only: Option, + /// Title of the key to add + #[serde(rename = "title")] + title: String +} + +impl CreateKeyOption { + /// CreateKeyOption options when creating a key + pub fn new(key: String, title: String) -> CreateKeyOption { + CreateKeyOption { + key: key, + read_only: None, + title: title + } + } + + pub fn set_key(&mut self, key: String) { + self.key = key; + } + + pub fn with_key(mut self, key: String) -> CreateKeyOption { + self.key = key; + self + } + + pub fn key(&self) -> &String { + &self.key + } + + + pub fn set_read_only(&mut self, read_only: bool) { + self.read_only = Some(read_only); + } + + pub fn with_read_only(mut self, read_only: bool) -> CreateKeyOption { + self.read_only = Some(read_only); + self + } + + pub fn read_only(&self) -> Option<&bool> { + self.read_only.as_ref() + } + + pub fn reset_read_only(&mut self) { + self.read_only = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = title; + } + + pub fn with_title(mut self, title: String) -> CreateKeyOption { + self.title = title; + self + } + + pub fn title(&self) -> &String { + &self.title + } + + +} + + + diff --git a/src/models/create_label_option.rs b/src/models/create_label_option.rs new file mode 100644 index 0000000..4b515d8 --- /dev/null +++ b/src/models/create_label_option.rs @@ -0,0 +1,84 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateLabelOption : CreateLabelOption options for creating a label + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateLabelOption { + #[serde(rename = "color")] + color: String, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "name")] + name: String +} + +impl CreateLabelOption { + /// CreateLabelOption options for creating a label + pub fn new(color: String, name: String) -> CreateLabelOption { + CreateLabelOption { + color: color, + description: None, + name: name + } + } + + pub fn set_color(&mut self, color: String) { + self.color = color; + } + + pub fn with_color(mut self, color: String) -> CreateLabelOption { + self.color = color; + self + } + + pub fn color(&self) -> &String { + &self.color + } + + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> CreateLabelOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = name; + } + + pub fn with_name(mut self, name: String) -> CreateLabelOption { + self.name = name; + self + } + + pub fn name(&self) -> &String { + &self.name + } + + +} + + + diff --git a/src/models/create_milestone_option.rs b/src/models/create_milestone_option.rs new file mode 100644 index 0000000..56b2aca --- /dev/null +++ b/src/models/create_milestone_option.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateMilestoneOption : CreateMilestoneOption options for creating a milestone + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateMilestoneOption { + #[serde(rename = "description")] + description: Option, + #[serde(rename = "due_on")] + due_on: Option, + #[serde(rename = "title")] + title: Option +} + +impl CreateMilestoneOption { + /// CreateMilestoneOption options for creating a milestone + pub fn new() -> CreateMilestoneOption { + CreateMilestoneOption { + description: None, + due_on: None, + title: None + } + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> CreateMilestoneOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_due_on(&mut self, due_on: String) { + self.due_on = Some(due_on); + } + + pub fn with_due_on(mut self, due_on: String) -> CreateMilestoneOption { + self.due_on = Some(due_on); + self + } + + pub fn due_on(&self) -> Option<&String> { + self.due_on.as_ref() + } + + pub fn reset_due_on(&mut self) { + self.due_on = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> CreateMilestoneOption { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + +} + + + diff --git a/src/models/create_org_option.rs b/src/models/create_org_option.rs new file mode 100644 index 0000000..9addd68 --- /dev/null +++ b/src/models/create_org_option.rs @@ -0,0 +1,168 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateOrgOption : CreateOrgOption options for creating an organization + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateOrgOption { + #[serde(rename = "description")] + description: Option, + #[serde(rename = "full_name")] + full_name: Option, + #[serde(rename = "location")] + location: Option, + #[serde(rename = "repo_admin_change_team_access")] + repo_admin_change_team_access: Option, + #[serde(rename = "username")] + username: String, + /// possible values are `public` (default), `limited` or `private` + #[serde(rename = "visibility")] + visibility: Option, + #[serde(rename = "website")] + website: Option +} + +impl CreateOrgOption { + /// CreateOrgOption options for creating an organization + pub fn new(username: String) -> CreateOrgOption { + CreateOrgOption { + description: None, + full_name: None, + location: None, + repo_admin_change_team_access: None, + username: username, + visibility: None, + website: None + } + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> CreateOrgOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_full_name(&mut self, full_name: String) { + self.full_name = Some(full_name); + } + + pub fn with_full_name(mut self, full_name: String) -> CreateOrgOption { + self.full_name = Some(full_name); + self + } + + pub fn full_name(&self) -> Option<&String> { + self.full_name.as_ref() + } + + pub fn reset_full_name(&mut self) { + self.full_name = None; + } + + pub fn set_location(&mut self, location: String) { + self.location = Some(location); + } + + pub fn with_location(mut self, location: String) -> CreateOrgOption { + self.location = Some(location); + self + } + + pub fn location(&self) -> Option<&String> { + self.location.as_ref() + } + + pub fn reset_location(&mut self) { + self.location = None; + } + + pub fn set_repo_admin_change_team_access(&mut self, repo_admin_change_team_access: bool) { + self.repo_admin_change_team_access = Some(repo_admin_change_team_access); + } + + pub fn with_repo_admin_change_team_access(mut self, repo_admin_change_team_access: bool) -> CreateOrgOption { + self.repo_admin_change_team_access = Some(repo_admin_change_team_access); + self + } + + pub fn repo_admin_change_team_access(&self) -> Option<&bool> { + self.repo_admin_change_team_access.as_ref() + } + + pub fn reset_repo_admin_change_team_access(&mut self) { + self.repo_admin_change_team_access = None; + } + + pub fn set_username(&mut self, username: String) { + self.username = username; + } + + pub fn with_username(mut self, username: String) -> CreateOrgOption { + self.username = username; + self + } + + pub fn username(&self) -> &String { + &self.username + } + + + pub fn set_visibility(&mut self, visibility: String) { + self.visibility = Some(visibility); + } + + pub fn with_visibility(mut self, visibility: String) -> CreateOrgOption { + self.visibility = Some(visibility); + self + } + + pub fn visibility(&self) -> Option<&String> { + self.visibility.as_ref() + } + + pub fn reset_visibility(&mut self) { + self.visibility = None; + } + + pub fn set_website(&mut self, website: String) { + self.website = Some(website); + } + + pub fn with_website(mut self, website: String) -> CreateOrgOption { + self.website = Some(website); + self + } + + pub fn website(&self) -> Option<&String> { + self.website.as_ref() + } + + pub fn reset_website(&mut self) { + self.website = None; + } + +} + + + diff --git a/src/models/create_pull_request_option.rs b/src/models/create_pull_request_option.rs new file mode 100644 index 0000000..53d4452 --- /dev/null +++ b/src/models/create_pull_request_option.rs @@ -0,0 +1,210 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreatePullRequestOption : CreatePullRequestOption options when creating a pull request + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreatePullRequestOption { + #[serde(rename = "assignee")] + assignee: Option, + #[serde(rename = "assignees")] + assignees: Option>, + #[serde(rename = "base")] + base: Option, + #[serde(rename = "body")] + body: Option, + #[serde(rename = "due_date")] + due_date: Option, + #[serde(rename = "head")] + head: Option, + #[serde(rename = "labels")] + labels: Option>, + #[serde(rename = "milestone")] + milestone: Option, + #[serde(rename = "title")] + title: Option +} + +impl CreatePullRequestOption { + /// CreatePullRequestOption options when creating a pull request + pub fn new() -> CreatePullRequestOption { + CreatePullRequestOption { + assignee: None, + assignees: None, + base: None, + body: None, + due_date: None, + head: None, + labels: None, + milestone: None, + title: None + } + } + + pub fn set_assignee(&mut self, assignee: String) { + self.assignee = Some(assignee); + } + + pub fn with_assignee(mut self, assignee: String) -> CreatePullRequestOption { + self.assignee = Some(assignee); + self + } + + pub fn assignee(&self) -> Option<&String> { + self.assignee.as_ref() + } + + pub fn reset_assignee(&mut self) { + self.assignee = None; + } + + pub fn set_assignees(&mut self, assignees: Vec) { + self.assignees = Some(assignees); + } + + pub fn with_assignees(mut self, assignees: Vec) -> CreatePullRequestOption { + self.assignees = Some(assignees); + self + } + + pub fn assignees(&self) -> Option<&Vec> { + self.assignees.as_ref() + } + + pub fn reset_assignees(&mut self) { + self.assignees = None; + } + + pub fn set_base(&mut self, base: String) { + self.base = Some(base); + } + + pub fn with_base(mut self, base: String) -> CreatePullRequestOption { + self.base = Some(base); + self + } + + pub fn base(&self) -> Option<&String> { + self.base.as_ref() + } + + pub fn reset_base(&mut self) { + self.base = None; + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> CreatePullRequestOption { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_due_date(&mut self, due_date: String) { + self.due_date = Some(due_date); + } + + pub fn with_due_date(mut self, due_date: String) -> CreatePullRequestOption { + self.due_date = Some(due_date); + self + } + + pub fn due_date(&self) -> Option<&String> { + self.due_date.as_ref() + } + + pub fn reset_due_date(&mut self) { + self.due_date = None; + } + + pub fn set_head(&mut self, head: String) { + self.head = Some(head); + } + + pub fn with_head(mut self, head: String) -> CreatePullRequestOption { + self.head = Some(head); + self + } + + pub fn head(&self) -> Option<&String> { + self.head.as_ref() + } + + pub fn reset_head(&mut self) { + self.head = None; + } + + pub fn set_labels(&mut self, labels: Vec) { + self.labels = Some(labels); + } + + pub fn with_labels(mut self, labels: Vec) -> CreatePullRequestOption { + self.labels = Some(labels); + self + } + + pub fn labels(&self) -> Option<&Vec> { + self.labels.as_ref() + } + + pub fn reset_labels(&mut self) { + self.labels = None; + } + + pub fn set_milestone(&mut self, milestone: i64) { + self.milestone = Some(milestone); + } + + pub fn with_milestone(mut self, milestone: i64) -> CreatePullRequestOption { + self.milestone = Some(milestone); + self + } + + pub fn milestone(&self) -> Option<&i64> { + self.milestone.as_ref() + } + + pub fn reset_milestone(&mut self) { + self.milestone = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> CreatePullRequestOption { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + +} + + + diff --git a/src/models/create_release_option.rs b/src/models/create_release_option.rs new file mode 100644 index 0000000..dd36e9d --- /dev/null +++ b/src/models/create_release_option.rs @@ -0,0 +1,147 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateReleaseOption : CreateReleaseOption options when creating a release + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateReleaseOption { + #[serde(rename = "body")] + body: Option, + #[serde(rename = "draft")] + draft: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "prerelease")] + prerelease: Option, + #[serde(rename = "tag_name")] + tag_name: String, + #[serde(rename = "target_commitish")] + target_commitish: Option +} + +impl CreateReleaseOption { + /// CreateReleaseOption options when creating a release + pub fn new(tag_name: String) -> CreateReleaseOption { + CreateReleaseOption { + body: None, + draft: None, + name: None, + prerelease: None, + tag_name: tag_name, + target_commitish: None + } + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> CreateReleaseOption { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_draft(&mut self, draft: bool) { + self.draft = Some(draft); + } + + pub fn with_draft(mut self, draft: bool) -> CreateReleaseOption { + self.draft = Some(draft); + self + } + + pub fn draft(&self) -> Option<&bool> { + self.draft.as_ref() + } + + pub fn reset_draft(&mut self) { + self.draft = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> CreateReleaseOption { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_prerelease(&mut self, prerelease: bool) { + self.prerelease = Some(prerelease); + } + + pub fn with_prerelease(mut self, prerelease: bool) -> CreateReleaseOption { + self.prerelease = Some(prerelease); + self + } + + pub fn prerelease(&self) -> Option<&bool> { + self.prerelease.as_ref() + } + + pub fn reset_prerelease(&mut self) { + self.prerelease = None; + } + + pub fn set_tag_name(&mut self, tag_name: String) { + self.tag_name = tag_name; + } + + pub fn with_tag_name(mut self, tag_name: String) -> CreateReleaseOption { + self.tag_name = tag_name; + self + } + + pub fn tag_name(&self) -> &String { + &self.tag_name + } + + + pub fn set_target_commitish(&mut self, target_commitish: String) { + self.target_commitish = Some(target_commitish); + } + + pub fn with_target_commitish(mut self, target_commitish: String) -> CreateReleaseOption { + self.target_commitish = Some(target_commitish); + self + } + + pub fn target_commitish(&self) -> Option<&String> { + self.target_commitish.as_ref() + } + + pub fn reset_target_commitish(&mut self) { + self.target_commitish = None; + } + +} + + + diff --git a/src/models/create_repo_option.rs b/src/models/create_repo_option.rs new file mode 100644 index 0000000..a02aafc --- /dev/null +++ b/src/models/create_repo_option.rs @@ -0,0 +1,195 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateRepoOption : CreateRepoOption options when creating repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateRepoOption { + /// Whether the repository should be auto-intialized? + #[serde(rename = "auto_init")] + auto_init: Option, + /// Description of the repository to create + #[serde(rename = "description")] + description: Option, + /// Gitignores to use + #[serde(rename = "gitignores")] + gitignores: Option, + /// Issue Label set to use + #[serde(rename = "issue_labels")] + issue_labels: Option, + /// License to use + #[serde(rename = "license")] + license: Option, + /// Name of the repository to create + #[serde(rename = "name")] + name: String, + /// Whether the repository is private + #[serde(rename = "private")] + private: Option, + /// Readme of the repository to create + #[serde(rename = "readme")] + readme: Option +} + +impl CreateRepoOption { + /// CreateRepoOption options when creating repository + pub fn new(name: String) -> CreateRepoOption { + CreateRepoOption { + auto_init: None, + description: None, + gitignores: None, + issue_labels: None, + license: None, + name: name, + private: None, + readme: None + } + } + + pub fn set_auto_init(&mut self, auto_init: bool) { + self.auto_init = Some(auto_init); + } + + pub fn with_auto_init(mut self, auto_init: bool) -> CreateRepoOption { + self.auto_init = Some(auto_init); + self + } + + pub fn auto_init(&self) -> Option<&bool> { + self.auto_init.as_ref() + } + + pub fn reset_auto_init(&mut self) { + self.auto_init = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> CreateRepoOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_gitignores(&mut self, gitignores: String) { + self.gitignores = Some(gitignores); + } + + pub fn with_gitignores(mut self, gitignores: String) -> CreateRepoOption { + self.gitignores = Some(gitignores); + self + } + + pub fn gitignores(&self) -> Option<&String> { + self.gitignores.as_ref() + } + + pub fn reset_gitignores(&mut self) { + self.gitignores = None; + } + + pub fn set_issue_labels(&mut self, issue_labels: String) { + self.issue_labels = Some(issue_labels); + } + + pub fn with_issue_labels(mut self, issue_labels: String) -> CreateRepoOption { + self.issue_labels = Some(issue_labels); + self + } + + pub fn issue_labels(&self) -> Option<&String> { + self.issue_labels.as_ref() + } + + pub fn reset_issue_labels(&mut self) { + self.issue_labels = None; + } + + pub fn set_license(&mut self, license: String) { + self.license = Some(license); + } + + pub fn with_license(mut self, license: String) -> CreateRepoOption { + self.license = Some(license); + self + } + + pub fn license(&self) -> Option<&String> { + self.license.as_ref() + } + + pub fn reset_license(&mut self) { + self.license = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = name; + } + + pub fn with_name(mut self, name: String) -> CreateRepoOption { + self.name = name; + self + } + + pub fn name(&self) -> &String { + &self.name + } + + + pub fn set_private(&mut self, private: bool) { + self.private = Some(private); + } + + pub fn with_private(mut self, private: bool) -> CreateRepoOption { + self.private = Some(private); + self + } + + pub fn private(&self) -> Option<&bool> { + self.private.as_ref() + } + + pub fn reset_private(&mut self) { + self.private = None; + } + + pub fn set_readme(&mut self, readme: String) { + self.readme = Some(readme); + } + + pub fn with_readme(mut self, readme: String) -> CreateRepoOption { + self.readme = Some(readme); + self + } + + pub fn readme(&self) -> Option<&String> { + self.readme.as_ref() + } + + pub fn reset_readme(&mut self) { + self.readme = None; + } + +} + + + diff --git a/src/models/create_status_option.rs b/src/models/create_status_option.rs new file mode 100644 index 0000000..fdccca4 --- /dev/null +++ b/src/models/create_status_option.rs @@ -0,0 +1,110 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateStatusOption : CreateStatusOption holds the information needed to create a new Status for a Commit + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateStatusOption { + #[serde(rename = "context")] + context: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "state")] + state: Option<::models::StatusState>, + #[serde(rename = "target_url")] + target_url: Option +} + +impl CreateStatusOption { + /// CreateStatusOption holds the information needed to create a new Status for a Commit + pub fn new() -> CreateStatusOption { + CreateStatusOption { + context: None, + description: None, + state: None, + target_url: None + } + } + + pub fn set_context(&mut self, context: String) { + self.context = Some(context); + } + + pub fn with_context(mut self, context: String) -> CreateStatusOption { + self.context = Some(context); + self + } + + pub fn context(&self) -> Option<&String> { + self.context.as_ref() + } + + pub fn reset_context(&mut self) { + self.context = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> CreateStatusOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_state(&mut self, state: ::models::StatusState) { + self.state = Some(state); + } + + pub fn with_state(mut self, state: ::models::StatusState) -> CreateStatusOption { + self.state = Some(state); + self + } + + pub fn state(&self) -> Option<&::models::StatusState> { + self.state.as_ref() + } + + pub fn reset_state(&mut self) { + self.state = None; + } + + pub fn set_target_url(&mut self, target_url: String) { + self.target_url = Some(target_url); + } + + pub fn with_target_url(mut self, target_url: String) -> CreateStatusOption { + self.target_url = Some(target_url); + self + } + + pub fn target_url(&self) -> Option<&String> { + self.target_url.as_ref() + } + + pub fn reset_target_url(&mut self) { + self.target_url = None; + } + +} + + + diff --git a/src/models/create_team_option.rs b/src/models/create_team_option.rs new file mode 100644 index 0000000..829ad70 --- /dev/null +++ b/src/models/create_team_option.rs @@ -0,0 +1,147 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateTeamOption : CreateTeamOption options for creating a team + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateTeamOption { + #[serde(rename = "can_create_org_repo")] + can_create_org_repo: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "includes_all_repositories")] + includes_all_repositories: Option, + #[serde(rename = "name")] + name: String, + #[serde(rename = "permission")] + permission: Option, + #[serde(rename = "units")] + units: Option> +} + +impl CreateTeamOption { + /// CreateTeamOption options for creating a team + pub fn new(name: String) -> CreateTeamOption { + CreateTeamOption { + can_create_org_repo: None, + description: None, + includes_all_repositories: None, + name: name, + permission: None, + units: None + } + } + + pub fn set_can_create_org_repo(&mut self, can_create_org_repo: bool) { + self.can_create_org_repo = Some(can_create_org_repo); + } + + pub fn with_can_create_org_repo(mut self, can_create_org_repo: bool) -> CreateTeamOption { + self.can_create_org_repo = Some(can_create_org_repo); + self + } + + pub fn can_create_org_repo(&self) -> Option<&bool> { + self.can_create_org_repo.as_ref() + } + + pub fn reset_can_create_org_repo(&mut self) { + self.can_create_org_repo = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> CreateTeamOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_includes_all_repositories(&mut self, includes_all_repositories: bool) { + self.includes_all_repositories = Some(includes_all_repositories); + } + + pub fn with_includes_all_repositories(mut self, includes_all_repositories: bool) -> CreateTeamOption { + self.includes_all_repositories = Some(includes_all_repositories); + self + } + + pub fn includes_all_repositories(&self) -> Option<&bool> { + self.includes_all_repositories.as_ref() + } + + pub fn reset_includes_all_repositories(&mut self) { + self.includes_all_repositories = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = name; + } + + pub fn with_name(mut self, name: String) -> CreateTeamOption { + self.name = name; + self + } + + pub fn name(&self) -> &String { + &self.name + } + + + pub fn set_permission(&mut self, permission: String) { + self.permission = Some(permission); + } + + pub fn with_permission(mut self, permission: String) -> CreateTeamOption { + self.permission = Some(permission); + self + } + + pub fn permission(&self) -> Option<&String> { + self.permission.as_ref() + } + + pub fn reset_permission(&mut self) { + self.permission = None; + } + + pub fn set_units(&mut self, units: Vec) { + self.units = Some(units); + } + + pub fn with_units(mut self, units: Vec) -> CreateTeamOption { + self.units = Some(units); + self + } + + pub fn units(&self) -> Option<&Vec> { + self.units.as_ref() + } + + pub fn reset_units(&mut self) { + self.units = None; + } + +} + + + diff --git a/src/models/create_user_option.rs b/src/models/create_user_option.rs new file mode 100644 index 0000000..775f326 --- /dev/null +++ b/src/models/create_user_option.rs @@ -0,0 +1,181 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// CreateUserOption : CreateUserOption create user options + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateUserOption { + #[serde(rename = "email")] + email: String, + #[serde(rename = "full_name")] + full_name: Option, + #[serde(rename = "login_name")] + login_name: Option, + #[serde(rename = "must_change_password")] + must_change_password: Option, + #[serde(rename = "password")] + password: String, + #[serde(rename = "send_notify")] + send_notify: Option, + #[serde(rename = "source_id")] + source_id: Option, + #[serde(rename = "username")] + username: String +} + +impl CreateUserOption { + /// CreateUserOption create user options + pub fn new(email: String, password: String, username: String) -> CreateUserOption { + CreateUserOption { + email: email, + full_name: None, + login_name: None, + must_change_password: None, + password: password, + send_notify: None, + source_id: None, + username: username + } + } + + pub fn set_email(&mut self, email: String) { + self.email = email; + } + + pub fn with_email(mut self, email: String) -> CreateUserOption { + self.email = email; + self + } + + pub fn email(&self) -> &String { + &self.email + } + + + pub fn set_full_name(&mut self, full_name: String) { + self.full_name = Some(full_name); + } + + pub fn with_full_name(mut self, full_name: String) -> CreateUserOption { + self.full_name = Some(full_name); + self + } + + pub fn full_name(&self) -> Option<&String> { + self.full_name.as_ref() + } + + pub fn reset_full_name(&mut self) { + self.full_name = None; + } + + pub fn set_login_name(&mut self, login_name: String) { + self.login_name = Some(login_name); + } + + pub fn with_login_name(mut self, login_name: String) -> CreateUserOption { + self.login_name = Some(login_name); + self + } + + pub fn login_name(&self) -> Option<&String> { + self.login_name.as_ref() + } + + pub fn reset_login_name(&mut self) { + self.login_name = None; + } + + pub fn set_must_change_password(&mut self, must_change_password: bool) { + self.must_change_password = Some(must_change_password); + } + + pub fn with_must_change_password(mut self, must_change_password: bool) -> CreateUserOption { + self.must_change_password = Some(must_change_password); + self + } + + pub fn must_change_password(&self) -> Option<&bool> { + self.must_change_password.as_ref() + } + + pub fn reset_must_change_password(&mut self) { + self.must_change_password = None; + } + + pub fn set_password(&mut self, password: String) { + self.password = password; + } + + pub fn with_password(mut self, password: String) -> CreateUserOption { + self.password = password; + self + } + + pub fn password(&self) -> &String { + &self.password + } + + + pub fn set_send_notify(&mut self, send_notify: bool) { + self.send_notify = Some(send_notify); + } + + pub fn with_send_notify(mut self, send_notify: bool) -> CreateUserOption { + self.send_notify = Some(send_notify); + self + } + + pub fn send_notify(&self) -> Option<&bool> { + self.send_notify.as_ref() + } + + pub fn reset_send_notify(&mut self) { + self.send_notify = None; + } + + pub fn set_source_id(&mut self, source_id: i64) { + self.source_id = Some(source_id); + } + + pub fn with_source_id(mut self, source_id: i64) -> CreateUserOption { + self.source_id = Some(source_id); + self + } + + pub fn source_id(&self) -> Option<&i64> { + self.source_id.as_ref() + } + + pub fn reset_source_id(&mut self) { + self.source_id = None; + } + + pub fn set_username(&mut self, username: String) { + self.username = username; + } + + pub fn with_username(mut self, username: String) -> CreateUserOption { + self.username = username; + self + } + + pub fn username(&self) -> &String { + &self.username + } + + +} + + + diff --git a/src/models/delete_email_option.rs b/src/models/delete_email_option.rs new file mode 100644 index 0000000..84e6d79 --- /dev/null +++ b/src/models/delete_email_option.rs @@ -0,0 +1,51 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// DeleteEmailOption : DeleteEmailOption options when deleting email addresses + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct DeleteEmailOption { + /// email addresses to delete + #[serde(rename = "emails")] + emails: Option> +} + +impl DeleteEmailOption { + /// DeleteEmailOption options when deleting email addresses + pub fn new() -> DeleteEmailOption { + DeleteEmailOption { + emails: None + } + } + + pub fn set_emails(&mut self, emails: Vec) { + self.emails = Some(emails); + } + + pub fn with_emails(mut self, emails: Vec) -> DeleteEmailOption { + self.emails = Some(emails); + self + } + + pub fn emails(&self) -> Option<&Vec> { + self.emails.as_ref() + } + + pub fn reset_emails(&mut self) { + self.emails = None; + } + +} + + + diff --git a/src/models/delete_file_options.rs b/src/models/delete_file_options.rs new file mode 100644 index 0000000..f32b895 --- /dev/null +++ b/src/models/delete_file_options.rs @@ -0,0 +1,171 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// DeleteFileOptions : DeleteFileOptions options for deleting files (used for other File structs below) Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct DeleteFileOptions { + #[serde(rename = "author")] + author: Option<::models::Identity>, + /// branch (optional) to base this file from. if not given, the default branch is used + #[serde(rename = "branch")] + branch: Option, + #[serde(rename = "committer")] + committer: Option<::models::Identity>, + #[serde(rename = "dates")] + dates: Option<::models::CommitDateOptions>, + /// message (optional) for the commit of this file. if not supplied, a default message will be used + #[serde(rename = "message")] + message: Option, + /// new_branch (optional) will make a new branch from `branch` before creating the file + #[serde(rename = "new_branch")] + new_branch: Option, + /// sha is the SHA for the file that already exists + #[serde(rename = "sha")] + sha: String +} + +impl DeleteFileOptions { + /// DeleteFileOptions options for deleting files (used for other File structs below) Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + pub fn new(sha: String) -> DeleteFileOptions { + DeleteFileOptions { + author: None, + branch: None, + committer: None, + dates: None, + message: None, + new_branch: None, + sha: sha + } + } + + pub fn set_author(&mut self, author: ::models::Identity) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: ::models::Identity) -> DeleteFileOptions { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&::models::Identity> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_branch(&mut self, branch: String) { + self.branch = Some(branch); + } + + pub fn with_branch(mut self, branch: String) -> DeleteFileOptions { + self.branch = Some(branch); + self + } + + pub fn branch(&self) -> Option<&String> { + self.branch.as_ref() + } + + pub fn reset_branch(&mut self) { + self.branch = None; + } + + pub fn set_committer(&mut self, committer: ::models::Identity) { + self.committer = Some(committer); + } + + pub fn with_committer(mut self, committer: ::models::Identity) -> DeleteFileOptions { + self.committer = Some(committer); + self + } + + pub fn committer(&self) -> Option<&::models::Identity> { + self.committer.as_ref() + } + + pub fn reset_committer(&mut self) { + self.committer = None; + } + + pub fn set_dates(&mut self, dates: ::models::CommitDateOptions) { + self.dates = Some(dates); + } + + pub fn with_dates(mut self, dates: ::models::CommitDateOptions) -> DeleteFileOptions { + self.dates = Some(dates); + self + } + + pub fn dates(&self) -> Option<&::models::CommitDateOptions> { + self.dates.as_ref() + } + + pub fn reset_dates(&mut self) { + self.dates = None; + } + + pub fn set_message(&mut self, message: String) { + self.message = Some(message); + } + + pub fn with_message(mut self, message: String) -> DeleteFileOptions { + self.message = Some(message); + self + } + + pub fn message(&self) -> Option<&String> { + self.message.as_ref() + } + + pub fn reset_message(&mut self) { + self.message = None; + } + + pub fn set_new_branch(&mut self, new_branch: String) { + self.new_branch = Some(new_branch); + } + + pub fn with_new_branch(mut self, new_branch: String) -> DeleteFileOptions { + self.new_branch = Some(new_branch); + self + } + + pub fn new_branch(&self) -> Option<&String> { + self.new_branch.as_ref() + } + + pub fn reset_new_branch(&mut self) { + self.new_branch = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = sha; + } + + pub fn with_sha(mut self, sha: String) -> DeleteFileOptions { + self.sha = sha; + self + } + + pub fn sha(&self) -> &String { + &self.sha + } + + +} + + + diff --git a/src/models/deploy_key.rs b/src/models/deploy_key.rs new file mode 100644 index 0000000..2ad4dd1 --- /dev/null +++ b/src/models/deploy_key.rs @@ -0,0 +1,210 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// DeployKey : DeployKey a deploy key + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct DeployKey { + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "fingerprint")] + fingerprint: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "key")] + key: Option, + #[serde(rename = "key_id")] + key_id: Option, + #[serde(rename = "read_only")] + read_only: Option, + #[serde(rename = "repository")] + repository: Option<::models::Repository>, + #[serde(rename = "title")] + title: Option, + #[serde(rename = "url")] + url: Option +} + +impl DeployKey { + /// DeployKey a deploy key + pub fn new() -> DeployKey { + DeployKey { + created_at: None, + fingerprint: None, + id: None, + key: None, + key_id: None, + read_only: None, + repository: None, + title: None, + url: None + } + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> DeployKey { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_fingerprint(&mut self, fingerprint: String) { + self.fingerprint = Some(fingerprint); + } + + pub fn with_fingerprint(mut self, fingerprint: String) -> DeployKey { + self.fingerprint = Some(fingerprint); + self + } + + pub fn fingerprint(&self) -> Option<&String> { + self.fingerprint.as_ref() + } + + pub fn reset_fingerprint(&mut self) { + self.fingerprint = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> DeployKey { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_key(&mut self, key: String) { + self.key = Some(key); + } + + pub fn with_key(mut self, key: String) -> DeployKey { + self.key = Some(key); + self + } + + pub fn key(&self) -> Option<&String> { + self.key.as_ref() + } + + pub fn reset_key(&mut self) { + self.key = None; + } + + pub fn set_key_id(&mut self, key_id: i64) { + self.key_id = Some(key_id); + } + + pub fn with_key_id(mut self, key_id: i64) -> DeployKey { + self.key_id = Some(key_id); + self + } + + pub fn key_id(&self) -> Option<&i64> { + self.key_id.as_ref() + } + + pub fn reset_key_id(&mut self) { + self.key_id = None; + } + + pub fn set_read_only(&mut self, read_only: bool) { + self.read_only = Some(read_only); + } + + pub fn with_read_only(mut self, read_only: bool) -> DeployKey { + self.read_only = Some(read_only); + self + } + + pub fn read_only(&self) -> Option<&bool> { + self.read_only.as_ref() + } + + pub fn reset_read_only(&mut self) { + self.read_only = None; + } + + pub fn set_repository(&mut self, repository: ::models::Repository) { + self.repository = Some(repository); + } + + pub fn with_repository(mut self, repository: ::models::Repository) -> DeployKey { + self.repository = Some(repository); + self + } + + pub fn repository(&self) -> Option<&::models::Repository> { + self.repository.as_ref() + } + + pub fn reset_repository(&mut self) { + self.repository = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> DeployKey { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> DeployKey { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/edit_attachment_options.rs b/src/models/edit_attachment_options.rs new file mode 100644 index 0000000..8948939 --- /dev/null +++ b/src/models/edit_attachment_options.rs @@ -0,0 +1,50 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditAttachmentOptions : EditAttachmentOptions options for editing attachments + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditAttachmentOptions { + #[serde(rename = "name")] + name: Option +} + +impl EditAttachmentOptions { + /// EditAttachmentOptions options for editing attachments + pub fn new() -> EditAttachmentOptions { + EditAttachmentOptions { + name: None + } + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> EditAttachmentOptions { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + +} + + + diff --git a/src/models/edit_deadline_option.rs b/src/models/edit_deadline_option.rs new file mode 100644 index 0000000..fcbf5ed --- /dev/null +++ b/src/models/edit_deadline_option.rs @@ -0,0 +1,47 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditDeadlineOption : EditDeadlineOption options for creating a deadline + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditDeadlineOption { + #[serde(rename = "due_date")] + due_date: String +} + +impl EditDeadlineOption { + /// EditDeadlineOption options for creating a deadline + pub fn new(due_date: String) -> EditDeadlineOption { + EditDeadlineOption { + due_date: due_date + } + } + + pub fn set_due_date(&mut self, due_date: String) { + self.due_date = due_date; + } + + pub fn with_due_date(mut self, due_date: String) -> EditDeadlineOption { + self.due_date = due_date; + self + } + + pub fn due_date(&self) -> &String { + &self.due_date + } + + +} + + + diff --git a/src/models/edit_git_hook_option.rs b/src/models/edit_git_hook_option.rs new file mode 100644 index 0000000..82de201 --- /dev/null +++ b/src/models/edit_git_hook_option.rs @@ -0,0 +1,50 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditGitHookOption : EditGitHookOption options when modifying one Git hook + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditGitHookOption { + #[serde(rename = "content")] + content: Option +} + +impl EditGitHookOption { + /// EditGitHookOption options when modifying one Git hook + pub fn new() -> EditGitHookOption { + EditGitHookOption { + content: None + } + } + + pub fn set_content(&mut self, content: String) { + self.content = Some(content); + } + + pub fn with_content(mut self, content: String) -> EditGitHookOption { + self.content = Some(content); + self + } + + pub fn content(&self) -> Option<&String> { + self.content.as_ref() + } + + pub fn reset_content(&mut self) { + self.content = None; + } + +} + + + diff --git a/src/models/edit_hook_option.rs b/src/models/edit_hook_option.rs new file mode 100644 index 0000000..f1dded6 --- /dev/null +++ b/src/models/edit_hook_option.rs @@ -0,0 +1,110 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditHookOption : EditHookOption options when modify one hook + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditHookOption { + #[serde(rename = "active")] + active: Option, + #[serde(rename = "branch_filter")] + branch_filter: Option, + #[serde(rename = "config")] + config: Option<::std::collections::HashMap>, + #[serde(rename = "events")] + events: Option> +} + +impl EditHookOption { + /// EditHookOption options when modify one hook + pub fn new() -> EditHookOption { + EditHookOption { + active: None, + branch_filter: None, + config: None, + events: None + } + } + + pub fn set_active(&mut self, active: bool) { + self.active = Some(active); + } + + pub fn with_active(mut self, active: bool) -> EditHookOption { + self.active = Some(active); + self + } + + pub fn active(&self) -> Option<&bool> { + self.active.as_ref() + } + + pub fn reset_active(&mut self) { + self.active = None; + } + + pub fn set_branch_filter(&mut self, branch_filter: String) { + self.branch_filter = Some(branch_filter); + } + + pub fn with_branch_filter(mut self, branch_filter: String) -> EditHookOption { + self.branch_filter = Some(branch_filter); + self + } + + pub fn branch_filter(&self) -> Option<&String> { + self.branch_filter.as_ref() + } + + pub fn reset_branch_filter(&mut self) { + self.branch_filter = None; + } + + pub fn set_config(&mut self, config: ::std::collections::HashMap) { + self.config = Some(config); + } + + pub fn with_config(mut self, config: ::std::collections::HashMap) -> EditHookOption { + self.config = Some(config); + self + } + + pub fn config(&self) -> Option<&::std::collections::HashMap> { + self.config.as_ref() + } + + pub fn reset_config(&mut self) { + self.config = None; + } + + pub fn set_events(&mut self, events: Vec) { + self.events = Some(events); + } + + pub fn with_events(mut self, events: Vec) -> EditHookOption { + self.events = Some(events); + self + } + + pub fn events(&self) -> Option<&Vec> { + self.events.as_ref() + } + + pub fn reset_events(&mut self) { + self.events = None; + } + +} + + + diff --git a/src/models/edit_issue_comment_option.rs b/src/models/edit_issue_comment_option.rs new file mode 100644 index 0000000..d371c9b --- /dev/null +++ b/src/models/edit_issue_comment_option.rs @@ -0,0 +1,47 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditIssueCommentOption : EditIssueCommentOption options for editing a comment + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditIssueCommentOption { + #[serde(rename = "body")] + body: String +} + +impl EditIssueCommentOption { + /// EditIssueCommentOption options for editing a comment + pub fn new(body: String) -> EditIssueCommentOption { + EditIssueCommentOption { + body: body + } + } + + pub fn set_body(&mut self, body: String) { + self.body = body; + } + + pub fn with_body(mut self, body: String) -> EditIssueCommentOption { + self.body = body; + self + } + + pub fn body(&self) -> &String { + &self.body + } + + +} + + + diff --git a/src/models/edit_issue_option.rs b/src/models/edit_issue_option.rs new file mode 100644 index 0000000..92daf4c --- /dev/null +++ b/src/models/edit_issue_option.rs @@ -0,0 +1,190 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditIssueOption : EditIssueOption options for editing an issue + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditIssueOption { + #[serde(rename = "assignee")] + assignee: Option, + #[serde(rename = "assignees")] + assignees: Option>, + #[serde(rename = "body")] + body: Option, + #[serde(rename = "due_date")] + due_date: Option, + #[serde(rename = "milestone")] + milestone: Option, + #[serde(rename = "state")] + state: Option, + #[serde(rename = "title")] + title: Option, + #[serde(rename = "unset_due_date")] + unset_due_date: Option +} + +impl EditIssueOption { + /// EditIssueOption options for editing an issue + pub fn new() -> EditIssueOption { + EditIssueOption { + assignee: None, + assignees: None, + body: None, + due_date: None, + milestone: None, + state: None, + title: None, + unset_due_date: None + } + } + + pub fn set_assignee(&mut self, assignee: String) { + self.assignee = Some(assignee); + } + + pub fn with_assignee(mut self, assignee: String) -> EditIssueOption { + self.assignee = Some(assignee); + self + } + + pub fn assignee(&self) -> Option<&String> { + self.assignee.as_ref() + } + + pub fn reset_assignee(&mut self) { + self.assignee = None; + } + + pub fn set_assignees(&mut self, assignees: Vec) { + self.assignees = Some(assignees); + } + + pub fn with_assignees(mut self, assignees: Vec) -> EditIssueOption { + self.assignees = Some(assignees); + self + } + + pub fn assignees(&self) -> Option<&Vec> { + self.assignees.as_ref() + } + + pub fn reset_assignees(&mut self) { + self.assignees = None; + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> EditIssueOption { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_due_date(&mut self, due_date: String) { + self.due_date = Some(due_date); + } + + pub fn with_due_date(mut self, due_date: String) -> EditIssueOption { + self.due_date = Some(due_date); + self + } + + pub fn due_date(&self) -> Option<&String> { + self.due_date.as_ref() + } + + pub fn reset_due_date(&mut self) { + self.due_date = None; + } + + pub fn set_milestone(&mut self, milestone: i64) { + self.milestone = Some(milestone); + } + + pub fn with_milestone(mut self, milestone: i64) -> EditIssueOption { + self.milestone = Some(milestone); + self + } + + pub fn milestone(&self) -> Option<&i64> { + self.milestone.as_ref() + } + + pub fn reset_milestone(&mut self) { + self.milestone = None; + } + + pub fn set_state(&mut self, state: String) { + self.state = Some(state); + } + + pub fn with_state(mut self, state: String) -> EditIssueOption { + self.state = Some(state); + self + } + + pub fn state(&self) -> Option<&String> { + self.state.as_ref() + } + + pub fn reset_state(&mut self) { + self.state = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> EditIssueOption { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + + pub fn set_unset_due_date(&mut self, unset_due_date: bool) { + self.unset_due_date = Some(unset_due_date); + } + + pub fn with_unset_due_date(mut self, unset_due_date: bool) -> EditIssueOption { + self.unset_due_date = Some(unset_due_date); + self + } + + pub fn unset_due_date(&self) -> Option<&bool> { + self.unset_due_date.as_ref() + } + + pub fn reset_unset_due_date(&mut self) { + self.unset_due_date = None; + } + +} + + + diff --git a/src/models/edit_label_option.rs b/src/models/edit_label_option.rs new file mode 100644 index 0000000..6d78256 --- /dev/null +++ b/src/models/edit_label_option.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditLabelOption : EditLabelOption options for editing a label + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditLabelOption { + #[serde(rename = "color")] + color: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "name")] + name: Option +} + +impl EditLabelOption { + /// EditLabelOption options for editing a label + pub fn new() -> EditLabelOption { + EditLabelOption { + color: None, + description: None, + name: None + } + } + + pub fn set_color(&mut self, color: String) { + self.color = Some(color); + } + + pub fn with_color(mut self, color: String) -> EditLabelOption { + self.color = Some(color); + self + } + + pub fn color(&self) -> Option<&String> { + self.color.as_ref() + } + + pub fn reset_color(&mut self) { + self.color = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> EditLabelOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> EditLabelOption { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + +} + + + diff --git a/src/models/edit_milestone_option.rs b/src/models/edit_milestone_option.rs new file mode 100644 index 0000000..6bcdf14 --- /dev/null +++ b/src/models/edit_milestone_option.rs @@ -0,0 +1,110 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditMilestoneOption : EditMilestoneOption options for editing a milestone + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditMilestoneOption { + #[serde(rename = "description")] + description: Option, + #[serde(rename = "due_on")] + due_on: Option, + #[serde(rename = "state")] + state: Option, + #[serde(rename = "title")] + title: Option +} + +impl EditMilestoneOption { + /// EditMilestoneOption options for editing a milestone + pub fn new() -> EditMilestoneOption { + EditMilestoneOption { + description: None, + due_on: None, + state: None, + title: None + } + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> EditMilestoneOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_due_on(&mut self, due_on: String) { + self.due_on = Some(due_on); + } + + pub fn with_due_on(mut self, due_on: String) -> EditMilestoneOption { + self.due_on = Some(due_on); + self + } + + pub fn due_on(&self) -> Option<&String> { + self.due_on.as_ref() + } + + pub fn reset_due_on(&mut self) { + self.due_on = None; + } + + pub fn set_state(&mut self, state: String) { + self.state = Some(state); + } + + pub fn with_state(mut self, state: String) -> EditMilestoneOption { + self.state = Some(state); + self + } + + pub fn state(&self) -> Option<&String> { + self.state.as_ref() + } + + pub fn reset_state(&mut self) { + self.state = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> EditMilestoneOption { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + +} + + + diff --git a/src/models/edit_org_option.rs b/src/models/edit_org_option.rs new file mode 100644 index 0000000..f54aa97 --- /dev/null +++ b/src/models/edit_org_option.rs @@ -0,0 +1,151 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditOrgOption : EditOrgOption options for editing an organization + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditOrgOption { + #[serde(rename = "description")] + description: Option, + #[serde(rename = "full_name")] + full_name: Option, + #[serde(rename = "location")] + location: Option, + #[serde(rename = "repo_admin_change_team_access")] + repo_admin_change_team_access: Option, + /// possible values are `public`, `limited` or `private` + #[serde(rename = "visibility")] + visibility: Option, + #[serde(rename = "website")] + website: Option +} + +impl EditOrgOption { + /// EditOrgOption options for editing an organization + pub fn new() -> EditOrgOption { + EditOrgOption { + description: None, + full_name: None, + location: None, + repo_admin_change_team_access: None, + visibility: None, + website: None + } + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> EditOrgOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_full_name(&mut self, full_name: String) { + self.full_name = Some(full_name); + } + + pub fn with_full_name(mut self, full_name: String) -> EditOrgOption { + self.full_name = Some(full_name); + self + } + + pub fn full_name(&self) -> Option<&String> { + self.full_name.as_ref() + } + + pub fn reset_full_name(&mut self) { + self.full_name = None; + } + + pub fn set_location(&mut self, location: String) { + self.location = Some(location); + } + + pub fn with_location(mut self, location: String) -> EditOrgOption { + self.location = Some(location); + self + } + + pub fn location(&self) -> Option<&String> { + self.location.as_ref() + } + + pub fn reset_location(&mut self) { + self.location = None; + } + + pub fn set_repo_admin_change_team_access(&mut self, repo_admin_change_team_access: bool) { + self.repo_admin_change_team_access = Some(repo_admin_change_team_access); + } + + pub fn with_repo_admin_change_team_access(mut self, repo_admin_change_team_access: bool) -> EditOrgOption { + self.repo_admin_change_team_access = Some(repo_admin_change_team_access); + self + } + + pub fn repo_admin_change_team_access(&self) -> Option<&bool> { + self.repo_admin_change_team_access.as_ref() + } + + pub fn reset_repo_admin_change_team_access(&mut self) { + self.repo_admin_change_team_access = None; + } + + pub fn set_visibility(&mut self, visibility: String) { + self.visibility = Some(visibility); + } + + pub fn with_visibility(mut self, visibility: String) -> EditOrgOption { + self.visibility = Some(visibility); + self + } + + pub fn visibility(&self) -> Option<&String> { + self.visibility.as_ref() + } + + pub fn reset_visibility(&mut self) { + self.visibility = None; + } + + pub fn set_website(&mut self, website: String) { + self.website = Some(website); + } + + pub fn with_website(mut self, website: String) -> EditOrgOption { + self.website = Some(website); + self + } + + pub fn website(&self) -> Option<&String> { + self.website.as_ref() + } + + pub fn reset_website(&mut self) { + self.website = None; + } + +} + + + diff --git a/src/models/edit_pull_request_option.rs b/src/models/edit_pull_request_option.rs new file mode 100644 index 0000000..d6064be --- /dev/null +++ b/src/models/edit_pull_request_option.rs @@ -0,0 +1,210 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditPullRequestOption : EditPullRequestOption options when modify pull request + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditPullRequestOption { + #[serde(rename = "assignee")] + assignee: Option, + #[serde(rename = "assignees")] + assignees: Option>, + #[serde(rename = "body")] + body: Option, + #[serde(rename = "due_date")] + due_date: Option, + #[serde(rename = "labels")] + labels: Option>, + #[serde(rename = "milestone")] + milestone: Option, + #[serde(rename = "state")] + state: Option, + #[serde(rename = "title")] + title: Option, + #[serde(rename = "unset_due_date")] + unset_due_date: Option +} + +impl EditPullRequestOption { + /// EditPullRequestOption options when modify pull request + pub fn new() -> EditPullRequestOption { + EditPullRequestOption { + assignee: None, + assignees: None, + body: None, + due_date: None, + labels: None, + milestone: None, + state: None, + title: None, + unset_due_date: None + } + } + + pub fn set_assignee(&mut self, assignee: String) { + self.assignee = Some(assignee); + } + + pub fn with_assignee(mut self, assignee: String) -> EditPullRequestOption { + self.assignee = Some(assignee); + self + } + + pub fn assignee(&self) -> Option<&String> { + self.assignee.as_ref() + } + + pub fn reset_assignee(&mut self) { + self.assignee = None; + } + + pub fn set_assignees(&mut self, assignees: Vec) { + self.assignees = Some(assignees); + } + + pub fn with_assignees(mut self, assignees: Vec) -> EditPullRequestOption { + self.assignees = Some(assignees); + self + } + + pub fn assignees(&self) -> Option<&Vec> { + self.assignees.as_ref() + } + + pub fn reset_assignees(&mut self) { + self.assignees = None; + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> EditPullRequestOption { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_due_date(&mut self, due_date: String) { + self.due_date = Some(due_date); + } + + pub fn with_due_date(mut self, due_date: String) -> EditPullRequestOption { + self.due_date = Some(due_date); + self + } + + pub fn due_date(&self) -> Option<&String> { + self.due_date.as_ref() + } + + pub fn reset_due_date(&mut self) { + self.due_date = None; + } + + pub fn set_labels(&mut self, labels: Vec) { + self.labels = Some(labels); + } + + pub fn with_labels(mut self, labels: Vec) -> EditPullRequestOption { + self.labels = Some(labels); + self + } + + pub fn labels(&self) -> Option<&Vec> { + self.labels.as_ref() + } + + pub fn reset_labels(&mut self) { + self.labels = None; + } + + pub fn set_milestone(&mut self, milestone: i64) { + self.milestone = Some(milestone); + } + + pub fn with_milestone(mut self, milestone: i64) -> EditPullRequestOption { + self.milestone = Some(milestone); + self + } + + pub fn milestone(&self) -> Option<&i64> { + self.milestone.as_ref() + } + + pub fn reset_milestone(&mut self) { + self.milestone = None; + } + + pub fn set_state(&mut self, state: String) { + self.state = Some(state); + } + + pub fn with_state(mut self, state: String) -> EditPullRequestOption { + self.state = Some(state); + self + } + + pub fn state(&self) -> Option<&String> { + self.state.as_ref() + } + + pub fn reset_state(&mut self) { + self.state = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> EditPullRequestOption { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + + pub fn set_unset_due_date(&mut self, unset_due_date: bool) { + self.unset_due_date = Some(unset_due_date); + } + + pub fn with_unset_due_date(mut self, unset_due_date: bool) -> EditPullRequestOption { + self.unset_due_date = Some(unset_due_date); + self + } + + pub fn unset_due_date(&self) -> Option<&bool> { + self.unset_due_date.as_ref() + } + + pub fn reset_unset_due_date(&mut self) { + self.unset_due_date = None; + } + +} + + + diff --git a/src/models/edit_reaction_option.rs b/src/models/edit_reaction_option.rs new file mode 100644 index 0000000..b68549a --- /dev/null +++ b/src/models/edit_reaction_option.rs @@ -0,0 +1,50 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditReactionOption : EditReactionOption contain the reaction type + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditReactionOption { + #[serde(rename = "content")] + content: Option +} + +impl EditReactionOption { + /// EditReactionOption contain the reaction type + pub fn new() -> EditReactionOption { + EditReactionOption { + content: None + } + } + + pub fn set_content(&mut self, content: String) { + self.content = Some(content); + } + + pub fn with_content(mut self, content: String) -> EditReactionOption { + self.content = Some(content); + self + } + + pub fn content(&self) -> Option<&String> { + self.content.as_ref() + } + + pub fn reset_content(&mut self) { + self.content = None; + } + +} + + + diff --git a/src/models/edit_release_option.rs b/src/models/edit_release_option.rs new file mode 100644 index 0000000..e5c48bd --- /dev/null +++ b/src/models/edit_release_option.rs @@ -0,0 +1,150 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditReleaseOption : EditReleaseOption options when editing a release + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditReleaseOption { + #[serde(rename = "body")] + body: Option, + #[serde(rename = "draft")] + draft: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "prerelease")] + prerelease: Option, + #[serde(rename = "tag_name")] + tag_name: Option, + #[serde(rename = "target_commitish")] + target_commitish: Option +} + +impl EditReleaseOption { + /// EditReleaseOption options when editing a release + pub fn new() -> EditReleaseOption { + EditReleaseOption { + body: None, + draft: None, + name: None, + prerelease: None, + tag_name: None, + target_commitish: None + } + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> EditReleaseOption { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_draft(&mut self, draft: bool) { + self.draft = Some(draft); + } + + pub fn with_draft(mut self, draft: bool) -> EditReleaseOption { + self.draft = Some(draft); + self + } + + pub fn draft(&self) -> Option<&bool> { + self.draft.as_ref() + } + + pub fn reset_draft(&mut self) { + self.draft = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> EditReleaseOption { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_prerelease(&mut self, prerelease: bool) { + self.prerelease = Some(prerelease); + } + + pub fn with_prerelease(mut self, prerelease: bool) -> EditReleaseOption { + self.prerelease = Some(prerelease); + self + } + + pub fn prerelease(&self) -> Option<&bool> { + self.prerelease.as_ref() + } + + pub fn reset_prerelease(&mut self) { + self.prerelease = None; + } + + pub fn set_tag_name(&mut self, tag_name: String) { + self.tag_name = Some(tag_name); + } + + pub fn with_tag_name(mut self, tag_name: String) -> EditReleaseOption { + self.tag_name = Some(tag_name); + self + } + + pub fn tag_name(&self) -> Option<&String> { + self.tag_name.as_ref() + } + + pub fn reset_tag_name(&mut self) { + self.tag_name = None; + } + + pub fn set_target_commitish(&mut self, target_commitish: String) { + self.target_commitish = Some(target_commitish); + } + + pub fn with_target_commitish(mut self, target_commitish: String) -> EditReleaseOption { + self.target_commitish = Some(target_commitish); + self + } + + pub fn target_commitish(&self) -> Option<&String> { + self.target_commitish.as_ref() + } + + pub fn reset_target_commitish(&mut self) { + self.target_commitish = None; + } + +} + + + diff --git a/src/models/edit_repo_option.rs b/src/models/edit_repo_option.rs new file mode 100644 index 0000000..27fbdbf --- /dev/null +++ b/src/models/edit_repo_option.rs @@ -0,0 +1,405 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditRepoOption : EditRepoOption options when editing a repository's properties + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditRepoOption { + /// either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. `has_pull_requests` must be `true`. + #[serde(rename = "allow_merge_commits")] + allow_merge_commits: Option, + /// either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. `has_pull_requests` must be `true`. + #[serde(rename = "allow_rebase")] + allow_rebase: Option, + /// either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits. `has_pull_requests` must be `true`. + #[serde(rename = "allow_rebase_explicit")] + allow_rebase_explicit: Option, + /// either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. `has_pull_requests` must be `true`. + #[serde(rename = "allow_squash_merge")] + allow_squash_merge: Option, + /// set to `true` to archive this repository. + #[serde(rename = "archived")] + archived: Option, + /// sets the default branch for this repository. + #[serde(rename = "default_branch")] + default_branch: Option, + /// a short description of the repository. + #[serde(rename = "description")] + description: Option, + #[serde(rename = "external_tracker")] + external_tracker: Option<::models::ExternalTracker>, + #[serde(rename = "external_wiki")] + external_wiki: Option<::models::ExternalWiki>, + /// either `true` to enable issues for this repository or `false` to disable them. + #[serde(rename = "has_issues")] + has_issues: Option, + /// either `true` to allow pull requests, or `false` to prevent pull request. + #[serde(rename = "has_pull_requests")] + has_pull_requests: Option, + /// either `true` to enable the wiki for this repository or `false` to disable it. + #[serde(rename = "has_wiki")] + has_wiki: Option, + /// either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. `has_pull_requests` must be `true`. + #[serde(rename = "ignore_whitespace_conflicts")] + ignore_whitespace_conflicts: Option, + #[serde(rename = "internal_tracker")] + internal_tracker: Option<::models::InternalTracker>, + /// name of the repository + #[serde(rename = "name")] + name: Option, + /// either `true` to make the repository private or `false` to make it public. Note: you will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private. + #[serde(rename = "private")] + private: Option, + /// either `true` to make this repository a template or `false` to make it a normal repository + #[serde(rename = "template")] + template: Option, + /// a URL with more information about the repository. + #[serde(rename = "website")] + website: Option +} + +impl EditRepoOption { + /// EditRepoOption options when editing a repository's properties + pub fn new() -> EditRepoOption { + EditRepoOption { + allow_merge_commits: None, + allow_rebase: None, + allow_rebase_explicit: None, + allow_squash_merge: None, + archived: None, + default_branch: None, + description: None, + external_tracker: None, + external_wiki: None, + has_issues: None, + has_pull_requests: None, + has_wiki: None, + ignore_whitespace_conflicts: None, + internal_tracker: None, + name: None, + private: None, + template: None, + website: None + } + } + + pub fn set_allow_merge_commits(&mut self, allow_merge_commits: bool) { + self.allow_merge_commits = Some(allow_merge_commits); + } + + pub fn with_allow_merge_commits(mut self, allow_merge_commits: bool) -> EditRepoOption { + self.allow_merge_commits = Some(allow_merge_commits); + self + } + + pub fn allow_merge_commits(&self) -> Option<&bool> { + self.allow_merge_commits.as_ref() + } + + pub fn reset_allow_merge_commits(&mut self) { + self.allow_merge_commits = None; + } + + pub fn set_allow_rebase(&mut self, allow_rebase: bool) { + self.allow_rebase = Some(allow_rebase); + } + + pub fn with_allow_rebase(mut self, allow_rebase: bool) -> EditRepoOption { + self.allow_rebase = Some(allow_rebase); + self + } + + pub fn allow_rebase(&self) -> Option<&bool> { + self.allow_rebase.as_ref() + } + + pub fn reset_allow_rebase(&mut self) { + self.allow_rebase = None; + } + + pub fn set_allow_rebase_explicit(&mut self, allow_rebase_explicit: bool) { + self.allow_rebase_explicit = Some(allow_rebase_explicit); + } + + pub fn with_allow_rebase_explicit(mut self, allow_rebase_explicit: bool) -> EditRepoOption { + self.allow_rebase_explicit = Some(allow_rebase_explicit); + self + } + + pub fn allow_rebase_explicit(&self) -> Option<&bool> { + self.allow_rebase_explicit.as_ref() + } + + pub fn reset_allow_rebase_explicit(&mut self) { + self.allow_rebase_explicit = None; + } + + pub fn set_allow_squash_merge(&mut self, allow_squash_merge: bool) { + self.allow_squash_merge = Some(allow_squash_merge); + } + + pub fn with_allow_squash_merge(mut self, allow_squash_merge: bool) -> EditRepoOption { + self.allow_squash_merge = Some(allow_squash_merge); + self + } + + pub fn allow_squash_merge(&self) -> Option<&bool> { + self.allow_squash_merge.as_ref() + } + + pub fn reset_allow_squash_merge(&mut self) { + self.allow_squash_merge = None; + } + + pub fn set_archived(&mut self, archived: bool) { + self.archived = Some(archived); + } + + pub fn with_archived(mut self, archived: bool) -> EditRepoOption { + self.archived = Some(archived); + self + } + + pub fn archived(&self) -> Option<&bool> { + self.archived.as_ref() + } + + pub fn reset_archived(&mut self) { + self.archived = None; + } + + pub fn set_default_branch(&mut self, default_branch: String) { + self.default_branch = Some(default_branch); + } + + pub fn with_default_branch(mut self, default_branch: String) -> EditRepoOption { + self.default_branch = Some(default_branch); + self + } + + pub fn default_branch(&self) -> Option<&String> { + self.default_branch.as_ref() + } + + pub fn reset_default_branch(&mut self) { + self.default_branch = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> EditRepoOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_external_tracker(&mut self, external_tracker: ::models::ExternalTracker) { + self.external_tracker = Some(external_tracker); + } + + pub fn with_external_tracker(mut self, external_tracker: ::models::ExternalTracker) -> EditRepoOption { + self.external_tracker = Some(external_tracker); + self + } + + pub fn external_tracker(&self) -> Option<&::models::ExternalTracker> { + self.external_tracker.as_ref() + } + + pub fn reset_external_tracker(&mut self) { + self.external_tracker = None; + } + + pub fn set_external_wiki(&mut self, external_wiki: ::models::ExternalWiki) { + self.external_wiki = Some(external_wiki); + } + + pub fn with_external_wiki(mut self, external_wiki: ::models::ExternalWiki) -> EditRepoOption { + self.external_wiki = Some(external_wiki); + self + } + + pub fn external_wiki(&self) -> Option<&::models::ExternalWiki> { + self.external_wiki.as_ref() + } + + pub fn reset_external_wiki(&mut self) { + self.external_wiki = None; + } + + pub fn set_has_issues(&mut self, has_issues: bool) { + self.has_issues = Some(has_issues); + } + + pub fn with_has_issues(mut self, has_issues: bool) -> EditRepoOption { + self.has_issues = Some(has_issues); + self + } + + pub fn has_issues(&self) -> Option<&bool> { + self.has_issues.as_ref() + } + + pub fn reset_has_issues(&mut self) { + self.has_issues = None; + } + + pub fn set_has_pull_requests(&mut self, has_pull_requests: bool) { + self.has_pull_requests = Some(has_pull_requests); + } + + pub fn with_has_pull_requests(mut self, has_pull_requests: bool) -> EditRepoOption { + self.has_pull_requests = Some(has_pull_requests); + self + } + + pub fn has_pull_requests(&self) -> Option<&bool> { + self.has_pull_requests.as_ref() + } + + pub fn reset_has_pull_requests(&mut self) { + self.has_pull_requests = None; + } + + pub fn set_has_wiki(&mut self, has_wiki: bool) { + self.has_wiki = Some(has_wiki); + } + + pub fn with_has_wiki(mut self, has_wiki: bool) -> EditRepoOption { + self.has_wiki = Some(has_wiki); + self + } + + pub fn has_wiki(&self) -> Option<&bool> { + self.has_wiki.as_ref() + } + + pub fn reset_has_wiki(&mut self) { + self.has_wiki = None; + } + + pub fn set_ignore_whitespace_conflicts(&mut self, ignore_whitespace_conflicts: bool) { + self.ignore_whitespace_conflicts = Some(ignore_whitespace_conflicts); + } + + pub fn with_ignore_whitespace_conflicts(mut self, ignore_whitespace_conflicts: bool) -> EditRepoOption { + self.ignore_whitespace_conflicts = Some(ignore_whitespace_conflicts); + self + } + + pub fn ignore_whitespace_conflicts(&self) -> Option<&bool> { + self.ignore_whitespace_conflicts.as_ref() + } + + pub fn reset_ignore_whitespace_conflicts(&mut self) { + self.ignore_whitespace_conflicts = None; + } + + pub fn set_internal_tracker(&mut self, internal_tracker: ::models::InternalTracker) { + self.internal_tracker = Some(internal_tracker); + } + + pub fn with_internal_tracker(mut self, internal_tracker: ::models::InternalTracker) -> EditRepoOption { + self.internal_tracker = Some(internal_tracker); + self + } + + pub fn internal_tracker(&self) -> Option<&::models::InternalTracker> { + self.internal_tracker.as_ref() + } + + pub fn reset_internal_tracker(&mut self) { + self.internal_tracker = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> EditRepoOption { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_private(&mut self, private: bool) { + self.private = Some(private); + } + + pub fn with_private(mut self, private: bool) -> EditRepoOption { + self.private = Some(private); + self + } + + pub fn private(&self) -> Option<&bool> { + self.private.as_ref() + } + + pub fn reset_private(&mut self) { + self.private = None; + } + + pub fn set_template(&mut self, template: bool) { + self.template = Some(template); + } + + pub fn with_template(mut self, template: bool) -> EditRepoOption { + self.template = Some(template); + self + } + + pub fn template(&self) -> Option<&bool> { + self.template.as_ref() + } + + pub fn reset_template(&mut self) { + self.template = None; + } + + pub fn set_website(&mut self, website: String) { + self.website = Some(website); + } + + pub fn with_website(mut self, website: String) -> EditRepoOption { + self.website = Some(website); + self + } + + pub fn website(&self) -> Option<&String> { + self.website.as_ref() + } + + pub fn reset_website(&mut self) { + self.website = None; + } + +} + + + diff --git a/src/models/edit_team_option.rs b/src/models/edit_team_option.rs new file mode 100644 index 0000000..71ff6e3 --- /dev/null +++ b/src/models/edit_team_option.rs @@ -0,0 +1,147 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditTeamOption : EditTeamOption options for editing a team + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditTeamOption { + #[serde(rename = "can_create_org_repo")] + can_create_org_repo: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "includes_all_repositories")] + includes_all_repositories: Option, + #[serde(rename = "name")] + name: String, + #[serde(rename = "permission")] + permission: Option, + #[serde(rename = "units")] + units: Option> +} + +impl EditTeamOption { + /// EditTeamOption options for editing a team + pub fn new(name: String) -> EditTeamOption { + EditTeamOption { + can_create_org_repo: None, + description: None, + includes_all_repositories: None, + name: name, + permission: None, + units: None + } + } + + pub fn set_can_create_org_repo(&mut self, can_create_org_repo: bool) { + self.can_create_org_repo = Some(can_create_org_repo); + } + + pub fn with_can_create_org_repo(mut self, can_create_org_repo: bool) -> EditTeamOption { + self.can_create_org_repo = Some(can_create_org_repo); + self + } + + pub fn can_create_org_repo(&self) -> Option<&bool> { + self.can_create_org_repo.as_ref() + } + + pub fn reset_can_create_org_repo(&mut self) { + self.can_create_org_repo = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> EditTeamOption { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_includes_all_repositories(&mut self, includes_all_repositories: bool) { + self.includes_all_repositories = Some(includes_all_repositories); + } + + pub fn with_includes_all_repositories(mut self, includes_all_repositories: bool) -> EditTeamOption { + self.includes_all_repositories = Some(includes_all_repositories); + self + } + + pub fn includes_all_repositories(&self) -> Option<&bool> { + self.includes_all_repositories.as_ref() + } + + pub fn reset_includes_all_repositories(&mut self) { + self.includes_all_repositories = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = name; + } + + pub fn with_name(mut self, name: String) -> EditTeamOption { + self.name = name; + self + } + + pub fn name(&self) -> &String { + &self.name + } + + + pub fn set_permission(&mut self, permission: String) { + self.permission = Some(permission); + } + + pub fn with_permission(mut self, permission: String) -> EditTeamOption { + self.permission = Some(permission); + self + } + + pub fn permission(&self) -> Option<&String> { + self.permission.as_ref() + } + + pub fn reset_permission(&mut self) { + self.permission = None; + } + + pub fn set_units(&mut self, units: Vec) { + self.units = Some(units); + } + + pub fn with_units(mut self, units: Vec) -> EditTeamOption { + self.units = Some(units); + self + } + + pub fn units(&self) -> Option<&Vec> { + self.units.as_ref() + } + + pub fn reset_units(&mut self) { + self.units = None; + } + +} + + + diff --git a/src/models/edit_user_option.rs b/src/models/edit_user_option.rs new file mode 100644 index 0000000..b775d6d --- /dev/null +++ b/src/models/edit_user_option.rs @@ -0,0 +1,327 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// EditUserOption : EditUserOption edit user options + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct EditUserOption { + #[serde(rename = "active")] + active: Option, + #[serde(rename = "admin")] + admin: Option, + #[serde(rename = "allow_create_organization")] + allow_create_organization: Option, + #[serde(rename = "allow_git_hook")] + allow_git_hook: Option, + #[serde(rename = "allow_import_local")] + allow_import_local: Option, + #[serde(rename = "email")] + email: String, + #[serde(rename = "full_name")] + full_name: Option, + #[serde(rename = "location")] + location: Option, + #[serde(rename = "login_name")] + login_name: Option, + #[serde(rename = "max_repo_creation")] + max_repo_creation: Option, + #[serde(rename = "must_change_password")] + must_change_password: Option, + #[serde(rename = "password")] + password: Option, + #[serde(rename = "prohibit_login")] + prohibit_login: Option, + #[serde(rename = "source_id")] + source_id: Option, + #[serde(rename = "website")] + website: Option +} + +impl EditUserOption { + /// EditUserOption edit user options + pub fn new(email: String) -> EditUserOption { + EditUserOption { + active: None, + admin: None, + allow_create_organization: None, + allow_git_hook: None, + allow_import_local: None, + email: email, + full_name: None, + location: None, + login_name: None, + max_repo_creation: None, + must_change_password: None, + password: None, + prohibit_login: None, + source_id: None, + website: None + } + } + + pub fn set_active(&mut self, active: bool) { + self.active = Some(active); + } + + pub fn with_active(mut self, active: bool) -> EditUserOption { + self.active = Some(active); + self + } + + pub fn active(&self) -> Option<&bool> { + self.active.as_ref() + } + + pub fn reset_active(&mut self) { + self.active = None; + } + + pub fn set_admin(&mut self, admin: bool) { + self.admin = Some(admin); + } + + pub fn with_admin(mut self, admin: bool) -> EditUserOption { + self.admin = Some(admin); + self + } + + pub fn admin(&self) -> Option<&bool> { + self.admin.as_ref() + } + + pub fn reset_admin(&mut self) { + self.admin = None; + } + + pub fn set_allow_create_organization(&mut self, allow_create_organization: bool) { + self.allow_create_organization = Some(allow_create_organization); + } + + pub fn with_allow_create_organization(mut self, allow_create_organization: bool) -> EditUserOption { + self.allow_create_organization = Some(allow_create_organization); + self + } + + pub fn allow_create_organization(&self) -> Option<&bool> { + self.allow_create_organization.as_ref() + } + + pub fn reset_allow_create_organization(&mut self) { + self.allow_create_organization = None; + } + + pub fn set_allow_git_hook(&mut self, allow_git_hook: bool) { + self.allow_git_hook = Some(allow_git_hook); + } + + pub fn with_allow_git_hook(mut self, allow_git_hook: bool) -> EditUserOption { + self.allow_git_hook = Some(allow_git_hook); + self + } + + pub fn allow_git_hook(&self) -> Option<&bool> { + self.allow_git_hook.as_ref() + } + + pub fn reset_allow_git_hook(&mut self) { + self.allow_git_hook = None; + } + + pub fn set_allow_import_local(&mut self, allow_import_local: bool) { + self.allow_import_local = Some(allow_import_local); + } + + pub fn with_allow_import_local(mut self, allow_import_local: bool) -> EditUserOption { + self.allow_import_local = Some(allow_import_local); + self + } + + pub fn allow_import_local(&self) -> Option<&bool> { + self.allow_import_local.as_ref() + } + + pub fn reset_allow_import_local(&mut self) { + self.allow_import_local = None; + } + + pub fn set_email(&mut self, email: String) { + self.email = email; + } + + pub fn with_email(mut self, email: String) -> EditUserOption { + self.email = email; + self + } + + pub fn email(&self) -> &String { + &self.email + } + + + pub fn set_full_name(&mut self, full_name: String) { + self.full_name = Some(full_name); + } + + pub fn with_full_name(mut self, full_name: String) -> EditUserOption { + self.full_name = Some(full_name); + self + } + + pub fn full_name(&self) -> Option<&String> { + self.full_name.as_ref() + } + + pub fn reset_full_name(&mut self) { + self.full_name = None; + } + + pub fn set_location(&mut self, location: String) { + self.location = Some(location); + } + + pub fn with_location(mut self, location: String) -> EditUserOption { + self.location = Some(location); + self + } + + pub fn location(&self) -> Option<&String> { + self.location.as_ref() + } + + pub fn reset_location(&mut self) { + self.location = None; + } + + pub fn set_login_name(&mut self, login_name: String) { + self.login_name = Some(login_name); + } + + pub fn with_login_name(mut self, login_name: String) -> EditUserOption { + self.login_name = Some(login_name); + self + } + + pub fn login_name(&self) -> Option<&String> { + self.login_name.as_ref() + } + + pub fn reset_login_name(&mut self) { + self.login_name = None; + } + + pub fn set_max_repo_creation(&mut self, max_repo_creation: i64) { + self.max_repo_creation = Some(max_repo_creation); + } + + pub fn with_max_repo_creation(mut self, max_repo_creation: i64) -> EditUserOption { + self.max_repo_creation = Some(max_repo_creation); + self + } + + pub fn max_repo_creation(&self) -> Option<&i64> { + self.max_repo_creation.as_ref() + } + + pub fn reset_max_repo_creation(&mut self) { + self.max_repo_creation = None; + } + + pub fn set_must_change_password(&mut self, must_change_password: bool) { + self.must_change_password = Some(must_change_password); + } + + pub fn with_must_change_password(mut self, must_change_password: bool) -> EditUserOption { + self.must_change_password = Some(must_change_password); + self + } + + pub fn must_change_password(&self) -> Option<&bool> { + self.must_change_password.as_ref() + } + + pub fn reset_must_change_password(&mut self) { + self.must_change_password = None; + } + + pub fn set_password(&mut self, password: String) { + self.password = Some(password); + } + + pub fn with_password(mut self, password: String) -> EditUserOption { + self.password = Some(password); + self + } + + pub fn password(&self) -> Option<&String> { + self.password.as_ref() + } + + pub fn reset_password(&mut self) { + self.password = None; + } + + pub fn set_prohibit_login(&mut self, prohibit_login: bool) { + self.prohibit_login = Some(prohibit_login); + } + + pub fn with_prohibit_login(mut self, prohibit_login: bool) -> EditUserOption { + self.prohibit_login = Some(prohibit_login); + self + } + + pub fn prohibit_login(&self) -> Option<&bool> { + self.prohibit_login.as_ref() + } + + pub fn reset_prohibit_login(&mut self) { + self.prohibit_login = None; + } + + pub fn set_source_id(&mut self, source_id: i64) { + self.source_id = Some(source_id); + } + + pub fn with_source_id(mut self, source_id: i64) -> EditUserOption { + self.source_id = Some(source_id); + self + } + + pub fn source_id(&self) -> Option<&i64> { + self.source_id.as_ref() + } + + pub fn reset_source_id(&mut self) { + self.source_id = None; + } + + pub fn set_website(&mut self, website: String) { + self.website = Some(website); + } + + pub fn with_website(mut self, website: String) -> EditUserOption { + self.website = Some(website); + self + } + + pub fn website(&self) -> Option<&String> { + self.website.as_ref() + } + + pub fn reset_website(&mut self) { + self.website = None; + } + +} + + + diff --git a/src/models/email.rs b/src/models/email.rs new file mode 100644 index 0000000..efb702a --- /dev/null +++ b/src/models/email.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Email : Email an email address belonging to a user + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Email { + #[serde(rename = "email")] + email: Option, + #[serde(rename = "primary")] + primary: Option, + #[serde(rename = "verified")] + verified: Option +} + +impl Email { + /// Email an email address belonging to a user + pub fn new() -> Email { + Email { + email: None, + primary: None, + verified: None + } + } + + pub fn set_email(&mut self, email: String) { + self.email = Some(email); + } + + pub fn with_email(mut self, email: String) -> Email { + self.email = Some(email); + self + } + + pub fn email(&self) -> Option<&String> { + self.email.as_ref() + } + + pub fn reset_email(&mut self) { + self.email = None; + } + + pub fn set_primary(&mut self, primary: bool) { + self.primary = Some(primary); + } + + pub fn with_primary(mut self, primary: bool) -> Email { + self.primary = Some(primary); + self + } + + pub fn primary(&self) -> Option<&bool> { + self.primary.as_ref() + } + + pub fn reset_primary(&mut self) { + self.primary = None; + } + + pub fn set_verified(&mut self, verified: bool) { + self.verified = Some(verified); + } + + pub fn with_verified(mut self, verified: bool) -> Email { + self.verified = Some(verified); + self + } + + pub fn verified(&self) -> Option<&bool> { + self.verified.as_ref() + } + + pub fn reset_verified(&mut self) { + self.verified = None; + } + +} + + + diff --git a/src/models/external_tracker.rs b/src/models/external_tracker.rs new file mode 100644 index 0000000..b7def28 --- /dev/null +++ b/src/models/external_tracker.rs @@ -0,0 +1,93 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// ExternalTracker : ExternalTracker represents settings for external tracker + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct ExternalTracker { + /// External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index. + #[serde(rename = "external_tracker_format")] + external_tracker_format: Option, + /// External Issue Tracker Number Format, either `numeric` or `alphanumeric` + #[serde(rename = "external_tracker_style")] + external_tracker_style: Option, + /// URL of external issue tracker. + #[serde(rename = "external_tracker_url")] + external_tracker_url: Option +} + +impl ExternalTracker { + /// ExternalTracker represents settings for external tracker + pub fn new() -> ExternalTracker { + ExternalTracker { + external_tracker_format: None, + external_tracker_style: None, + external_tracker_url: None + } + } + + pub fn set_external_tracker_format(&mut self, external_tracker_format: String) { + self.external_tracker_format = Some(external_tracker_format); + } + + pub fn with_external_tracker_format(mut self, external_tracker_format: String) -> ExternalTracker { + self.external_tracker_format = Some(external_tracker_format); + self + } + + pub fn external_tracker_format(&self) -> Option<&String> { + self.external_tracker_format.as_ref() + } + + pub fn reset_external_tracker_format(&mut self) { + self.external_tracker_format = None; + } + + pub fn set_external_tracker_style(&mut self, external_tracker_style: String) { + self.external_tracker_style = Some(external_tracker_style); + } + + pub fn with_external_tracker_style(mut self, external_tracker_style: String) -> ExternalTracker { + self.external_tracker_style = Some(external_tracker_style); + self + } + + pub fn external_tracker_style(&self) -> Option<&String> { + self.external_tracker_style.as_ref() + } + + pub fn reset_external_tracker_style(&mut self) { + self.external_tracker_style = None; + } + + pub fn set_external_tracker_url(&mut self, external_tracker_url: String) { + self.external_tracker_url = Some(external_tracker_url); + } + + pub fn with_external_tracker_url(mut self, external_tracker_url: String) -> ExternalTracker { + self.external_tracker_url = Some(external_tracker_url); + self + } + + pub fn external_tracker_url(&self) -> Option<&String> { + self.external_tracker_url.as_ref() + } + + pub fn reset_external_tracker_url(&mut self) { + self.external_tracker_url = None; + } + +} + + + diff --git a/src/models/external_wiki.rs b/src/models/external_wiki.rs new file mode 100644 index 0000000..472c557 --- /dev/null +++ b/src/models/external_wiki.rs @@ -0,0 +1,51 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// ExternalWiki : ExternalWiki represents setting for external wiki + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct ExternalWiki { + /// URL of external wiki. + #[serde(rename = "external_wiki_url")] + external_wiki_url: Option +} + +impl ExternalWiki { + /// ExternalWiki represents setting for external wiki + pub fn new() -> ExternalWiki { + ExternalWiki { + external_wiki_url: None + } + } + + pub fn set_external_wiki_url(&mut self, external_wiki_url: String) { + self.external_wiki_url = Some(external_wiki_url); + } + + pub fn with_external_wiki_url(mut self, external_wiki_url: String) -> ExternalWiki { + self.external_wiki_url = Some(external_wiki_url); + self + } + + pub fn external_wiki_url(&self) -> Option<&String> { + self.external_wiki_url.as_ref() + } + + pub fn reset_external_wiki_url(&mut self) { + self.external_wiki_url = None; + } + +} + + + diff --git a/src/models/file_commit_response.rs b/src/models/file_commit_response.rs new file mode 100644 index 0000000..a9b18e5 --- /dev/null +++ b/src/models/file_commit_response.rs @@ -0,0 +1,188 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct FileCommitResponse { + #[serde(rename = "author")] + author: Option<::models::CommitUser>, + #[serde(rename = "committer")] + committer: Option<::models::CommitUser>, + #[serde(rename = "html_url")] + html_url: Option, + #[serde(rename = "message")] + message: Option, + #[serde(rename = "parents")] + parents: Option>, + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "tree")] + tree: Option<::models::CommitMeta>, + #[serde(rename = "url")] + url: Option +} + +impl FileCommitResponse { + pub fn new() -> FileCommitResponse { + FileCommitResponse { + author: None, + committer: None, + html_url: None, + message: None, + parents: None, + sha: None, + tree: None, + url: None + } + } + + pub fn set_author(&mut self, author: ::models::CommitUser) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: ::models::CommitUser) -> FileCommitResponse { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&::models::CommitUser> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_committer(&mut self, committer: ::models::CommitUser) { + self.committer = Some(committer); + } + + pub fn with_committer(mut self, committer: ::models::CommitUser) -> FileCommitResponse { + self.committer = Some(committer); + self + } + + pub fn committer(&self) -> Option<&::models::CommitUser> { + self.committer.as_ref() + } + + pub fn reset_committer(&mut self) { + self.committer = None; + } + + pub fn set_html_url(&mut self, html_url: String) { + self.html_url = Some(html_url); + } + + pub fn with_html_url(mut self, html_url: String) -> FileCommitResponse { + self.html_url = Some(html_url); + self + } + + pub fn html_url(&self) -> Option<&String> { + self.html_url.as_ref() + } + + pub fn reset_html_url(&mut self) { + self.html_url = None; + } + + pub fn set_message(&mut self, message: String) { + self.message = Some(message); + } + + pub fn with_message(mut self, message: String) -> FileCommitResponse { + self.message = Some(message); + self + } + + pub fn message(&self) -> Option<&String> { + self.message.as_ref() + } + + pub fn reset_message(&mut self) { + self.message = None; + } + + pub fn set_parents(&mut self, parents: Vec<::models::CommitMeta>) { + self.parents = Some(parents); + } + + pub fn with_parents(mut self, parents: Vec<::models::CommitMeta>) -> FileCommitResponse { + self.parents = Some(parents); + self + } + + pub fn parents(&self) -> Option<&Vec<::models::CommitMeta>> { + self.parents.as_ref() + } + + pub fn reset_parents(&mut self) { + self.parents = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> FileCommitResponse { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set_tree(&mut self, tree: ::models::CommitMeta) { + self.tree = Some(tree); + } + + pub fn with_tree(mut self, tree: ::models::CommitMeta) -> FileCommitResponse { + self.tree = Some(tree); + self + } + + pub fn tree(&self) -> Option<&::models::CommitMeta> { + self.tree.as_ref() + } + + pub fn reset_tree(&mut self) { + self.tree = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> FileCommitResponse { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/file_delete_response.rs b/src/models/file_delete_response.rs new file mode 100644 index 0000000..e6f5cd5 --- /dev/null +++ b/src/models/file_delete_response.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// FileDeleteResponse : FileDeleteResponse contains information about a repo's file that was deleted + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct FileDeleteResponse { + #[serde(rename = "commit")] + commit: Option<::models::FileCommitResponse>, + #[serde(rename = "content")] + content: Option, + #[serde(rename = "verification")] + verification: Option<::models::PayloadCommitVerification> +} + +impl FileDeleteResponse { + /// FileDeleteResponse contains information about a repo's file that was deleted + pub fn new() -> FileDeleteResponse { + FileDeleteResponse { + commit: None, + content: None, + verification: None + } + } + + pub fn set_commit(&mut self, commit: ::models::FileCommitResponse) { + self.commit = Some(commit); + } + + pub fn with_commit(mut self, commit: ::models::FileCommitResponse) -> FileDeleteResponse { + self.commit = Some(commit); + self + } + + pub fn commit(&self) -> Option<&::models::FileCommitResponse> { + self.commit.as_ref() + } + + pub fn reset_commit(&mut self) { + self.commit = None; + } + + pub fn set_content(&mut self, content: Value) { + self.content = Some(content); + } + + pub fn with_content(mut self, content: Value) -> FileDeleteResponse { + self.content = Some(content); + self + } + + pub fn content(&self) -> Option<&Value> { + self.content.as_ref() + } + + pub fn reset_content(&mut self) { + self.content = None; + } + + pub fn set_verification(&mut self, verification: ::models::PayloadCommitVerification) { + self.verification = Some(verification); + } + + pub fn with_verification(mut self, verification: ::models::PayloadCommitVerification) -> FileDeleteResponse { + self.verification = Some(verification); + self + } + + pub fn verification(&self) -> Option<&::models::PayloadCommitVerification> { + self.verification.as_ref() + } + + pub fn reset_verification(&mut self) { + self.verification = None; + } + +} + + + diff --git a/src/models/file_links_response.rs b/src/models/file_links_response.rs new file mode 100644 index 0000000..36105cb --- /dev/null +++ b/src/models/file_links_response.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// FileLinksResponse : FileLinksResponse contains the links for a repo's file + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct FileLinksResponse { + #[serde(rename = "git")] + git: Option, + #[serde(rename = "html")] + html: Option, + #[serde(rename = "self")] + _self: Option +} + +impl FileLinksResponse { + /// FileLinksResponse contains the links for a repo's file + pub fn new() -> FileLinksResponse { + FileLinksResponse { + git: None, + html: None, + _self: None + } + } + + pub fn set_git(&mut self, git: String) { + self.git = Some(git); + } + + pub fn with_git(mut self, git: String) -> FileLinksResponse { + self.git = Some(git); + self + } + + pub fn git(&self) -> Option<&String> { + self.git.as_ref() + } + + pub fn reset_git(&mut self) { + self.git = None; + } + + pub fn set_html(&mut self, html: String) { + self.html = Some(html); + } + + pub fn with_html(mut self, html: String) -> FileLinksResponse { + self.html = Some(html); + self + } + + pub fn html(&self) -> Option<&String> { + self.html.as_ref() + } + + pub fn reset_html(&mut self) { + self.html = None; + } + + pub fn set__self(&mut self, _self: String) { + self._self = Some(_self); + } + + pub fn with__self(mut self, _self: String) -> FileLinksResponse { + self._self = Some(_self); + self + } + + pub fn _self(&self) -> Option<&String> { + self._self.as_ref() + } + + pub fn reset__self(&mut self) { + self._self = None; + } + +} + + + diff --git a/src/models/file_response.rs b/src/models/file_response.rs new file mode 100644 index 0000000..a55abc9 --- /dev/null +++ b/src/models/file_response.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// FileResponse : FileResponse contains information about a repo's file + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct FileResponse { + #[serde(rename = "commit")] + commit: Option<::models::FileCommitResponse>, + #[serde(rename = "content")] + content: Option<::models::ContentsResponse>, + #[serde(rename = "verification")] + verification: Option<::models::PayloadCommitVerification> +} + +impl FileResponse { + /// FileResponse contains information about a repo's file + pub fn new() -> FileResponse { + FileResponse { + commit: None, + content: None, + verification: None + } + } + + pub fn set_commit(&mut self, commit: ::models::FileCommitResponse) { + self.commit = Some(commit); + } + + pub fn with_commit(mut self, commit: ::models::FileCommitResponse) -> FileResponse { + self.commit = Some(commit); + self + } + + pub fn commit(&self) -> Option<&::models::FileCommitResponse> { + self.commit.as_ref() + } + + pub fn reset_commit(&mut self) { + self.commit = None; + } + + pub fn set_content(&mut self, content: ::models::ContentsResponse) { + self.content = Some(content); + } + + pub fn with_content(mut self, content: ::models::ContentsResponse) -> FileResponse { + self.content = Some(content); + self + } + + pub fn content(&self) -> Option<&::models::ContentsResponse> { + self.content.as_ref() + } + + pub fn reset_content(&mut self) { + self.content = None; + } + + pub fn set_verification(&mut self, verification: ::models::PayloadCommitVerification) { + self.verification = Some(verification); + } + + pub fn with_verification(mut self, verification: ::models::PayloadCommitVerification) -> FileResponse { + self.verification = Some(verification); + self + } + + pub fn verification(&self) -> Option<&::models::PayloadCommitVerification> { + self.verification.as_ref() + } + + pub fn reset_verification(&mut self) { + self.verification = None; + } + +} + + + diff --git a/src/models/git_blob_response.rs b/src/models/git_blob_response.rs new file mode 100644 index 0000000..18188fd --- /dev/null +++ b/src/models/git_blob_response.rs @@ -0,0 +1,130 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// GitBlobResponse : GitBlobResponse represents a git blob + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GitBlobResponse { + #[serde(rename = "content")] + content: Option, + #[serde(rename = "encoding")] + encoding: Option, + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "size")] + size: Option, + #[serde(rename = "url")] + url: Option +} + +impl GitBlobResponse { + /// GitBlobResponse represents a git blob + pub fn new() -> GitBlobResponse { + GitBlobResponse { + content: None, + encoding: None, + sha: None, + size: None, + url: None + } + } + + pub fn set_content(&mut self, content: String) { + self.content = Some(content); + } + + pub fn with_content(mut self, content: String) -> GitBlobResponse { + self.content = Some(content); + self + } + + pub fn content(&self) -> Option<&String> { + self.content.as_ref() + } + + pub fn reset_content(&mut self) { + self.content = None; + } + + pub fn set_encoding(&mut self, encoding: String) { + self.encoding = Some(encoding); + } + + pub fn with_encoding(mut self, encoding: String) -> GitBlobResponse { + self.encoding = Some(encoding); + self + } + + pub fn encoding(&self) -> Option<&String> { + self.encoding.as_ref() + } + + pub fn reset_encoding(&mut self) { + self.encoding = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> GitBlobResponse { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set_size(&mut self, size: i64) { + self.size = Some(size); + } + + pub fn with_size(mut self, size: i64) -> GitBlobResponse { + self.size = Some(size); + self + } + + pub fn size(&self) -> Option<&i64> { + self.size.as_ref() + } + + pub fn reset_size(&mut self) { + self.size = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> GitBlobResponse { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/git_entry.rs b/src/models/git_entry.rs new file mode 100644 index 0000000..7fcf0df --- /dev/null +++ b/src/models/git_entry.rs @@ -0,0 +1,150 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// GitEntry : GitEntry represents a git tree + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GitEntry { + #[serde(rename = "mode")] + mode: Option, + #[serde(rename = "path")] + path: Option, + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "size")] + size: Option, + #[serde(rename = "type")] + _type: Option, + #[serde(rename = "url")] + url: Option +} + +impl GitEntry { + /// GitEntry represents a git tree + pub fn new() -> GitEntry { + GitEntry { + mode: None, + path: None, + sha: None, + size: None, + _type: None, + url: None + } + } + + pub fn set_mode(&mut self, mode: String) { + self.mode = Some(mode); + } + + pub fn with_mode(mut self, mode: String) -> GitEntry { + self.mode = Some(mode); + self + } + + pub fn mode(&self) -> Option<&String> { + self.mode.as_ref() + } + + pub fn reset_mode(&mut self) { + self.mode = None; + } + + pub fn set_path(&mut self, path: String) { + self.path = Some(path); + } + + pub fn with_path(mut self, path: String) -> GitEntry { + self.path = Some(path); + self + } + + pub fn path(&self) -> Option<&String> { + self.path.as_ref() + } + + pub fn reset_path(&mut self) { + self.path = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> GitEntry { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set_size(&mut self, size: i64) { + self.size = Some(size); + } + + pub fn with_size(mut self, size: i64) -> GitEntry { + self.size = Some(size); + self + } + + pub fn size(&self) -> Option<&i64> { + self.size.as_ref() + } + + pub fn reset_size(&mut self) { + self.size = None; + } + + pub fn set__type(&mut self, _type: String) { + self._type = Some(_type); + } + + pub fn with__type(mut self, _type: String) -> GitEntry { + self._type = Some(_type); + self + } + + pub fn _type(&self) -> Option<&String> { + self._type.as_ref() + } + + pub fn reset__type(&mut self) { + self._type = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> GitEntry { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/git_hook.rs b/src/models/git_hook.rs new file mode 100644 index 0000000..9fd1a6c --- /dev/null +++ b/src/models/git_hook.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// GitHook : GitHook represents a Git repository hook + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GitHook { + #[serde(rename = "content")] + content: Option, + #[serde(rename = "is_active")] + is_active: Option, + #[serde(rename = "name")] + name: Option +} + +impl GitHook { + /// GitHook represents a Git repository hook + pub fn new() -> GitHook { + GitHook { + content: None, + is_active: None, + name: None + } + } + + pub fn set_content(&mut self, content: String) { + self.content = Some(content); + } + + pub fn with_content(mut self, content: String) -> GitHook { + self.content = Some(content); + self + } + + pub fn content(&self) -> Option<&String> { + self.content.as_ref() + } + + pub fn reset_content(&mut self) { + self.content = None; + } + + pub fn set_is_active(&mut self, is_active: bool) { + self.is_active = Some(is_active); + } + + pub fn with_is_active(mut self, is_active: bool) -> GitHook { + self.is_active = Some(is_active); + self + } + + pub fn is_active(&self) -> Option<&bool> { + self.is_active.as_ref() + } + + pub fn reset_is_active(&mut self) { + self.is_active = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> GitHook { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + +} + + + diff --git a/src/models/git_object.rs b/src/models/git_object.rs new file mode 100644 index 0000000..aa08d6a --- /dev/null +++ b/src/models/git_object.rs @@ -0,0 +1,88 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GitObject { + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "type")] + _type: Option, + #[serde(rename = "url")] + url: Option +} + +impl GitObject { + pub fn new() -> GitObject { + GitObject { + sha: None, + _type: None, + url: None + } + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> GitObject { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set__type(&mut self, _type: String) { + self._type = Some(_type); + } + + pub fn with__type(mut self, _type: String) -> GitObject { + self._type = Some(_type); + self + } + + pub fn _type(&self) -> Option<&String> { + self._type.as_ref() + } + + pub fn reset__type(&mut self) { + self._type = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> GitObject { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/git_tree_response.rs b/src/models/git_tree_response.rs new file mode 100644 index 0000000..5e78d72 --- /dev/null +++ b/src/models/git_tree_response.rs @@ -0,0 +1,150 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// GitTreeResponse : GitTreeResponse returns a git tree + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GitTreeResponse { + #[serde(rename = "page")] + page: Option, + #[serde(rename = "sha")] + sha: Option, + #[serde(rename = "total_count")] + total_count: Option, + #[serde(rename = "tree")] + tree: Option>, + #[serde(rename = "truncated")] + truncated: Option, + #[serde(rename = "url")] + url: Option +} + +impl GitTreeResponse { + /// GitTreeResponse returns a git tree + pub fn new() -> GitTreeResponse { + GitTreeResponse { + page: None, + sha: None, + total_count: None, + tree: None, + truncated: None, + url: None + } + } + + pub fn set_page(&mut self, page: i64) { + self.page = Some(page); + } + + pub fn with_page(mut self, page: i64) -> GitTreeResponse { + self.page = Some(page); + self + } + + pub fn page(&self) -> Option<&i64> { + self.page.as_ref() + } + + pub fn reset_page(&mut self) { + self.page = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> GitTreeResponse { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + + pub fn set_total_count(&mut self, total_count: i64) { + self.total_count = Some(total_count); + } + + pub fn with_total_count(mut self, total_count: i64) -> GitTreeResponse { + self.total_count = Some(total_count); + self + } + + pub fn total_count(&self) -> Option<&i64> { + self.total_count.as_ref() + } + + pub fn reset_total_count(&mut self) { + self.total_count = None; + } + + pub fn set_tree(&mut self, tree: Vec<::models::GitEntry>) { + self.tree = Some(tree); + } + + pub fn with_tree(mut self, tree: Vec<::models::GitEntry>) -> GitTreeResponse { + self.tree = Some(tree); + self + } + + pub fn tree(&self) -> Option<&Vec<::models::GitEntry>> { + self.tree.as_ref() + } + + pub fn reset_tree(&mut self) { + self.tree = None; + } + + pub fn set_truncated(&mut self, truncated: bool) { + self.truncated = Some(truncated); + } + + pub fn with_truncated(mut self, truncated: bool) -> GitTreeResponse { + self.truncated = Some(truncated); + self + } + + pub fn truncated(&self) -> Option<&bool> { + self.truncated.as_ref() + } + + pub fn reset_truncated(&mut self) { + self.truncated = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> GitTreeResponse { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/gpg_key.rs b/src/models/gpg_key.rs new file mode 100644 index 0000000..ed5df5f --- /dev/null +++ b/src/models/gpg_key.rs @@ -0,0 +1,270 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// GpgKey : GPGKey a user GPG key to sign commit and tag in repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GpgKey { + #[serde(rename = "can_certify")] + can_certify: Option, + #[serde(rename = "can_encrypt_comms")] + can_encrypt_comms: Option, + #[serde(rename = "can_encrypt_storage")] + can_encrypt_storage: Option, + #[serde(rename = "can_sign")] + can_sign: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "emails")] + emails: Option>, + #[serde(rename = "expires_at")] + expires_at: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "key_id")] + key_id: Option, + #[serde(rename = "primary_key_id")] + primary_key_id: Option, + #[serde(rename = "public_key")] + public_key: Option, + #[serde(rename = "subkeys")] + subkeys: Option> +} + +impl GpgKey { + /// GPGKey a user GPG key to sign commit and tag in repository + pub fn new() -> GpgKey { + GpgKey { + can_certify: None, + can_encrypt_comms: None, + can_encrypt_storage: None, + can_sign: None, + created_at: None, + emails: None, + expires_at: None, + id: None, + key_id: None, + primary_key_id: None, + public_key: None, + subkeys: None + } + } + + pub fn set_can_certify(&mut self, can_certify: bool) { + self.can_certify = Some(can_certify); + } + + pub fn with_can_certify(mut self, can_certify: bool) -> GpgKey { + self.can_certify = Some(can_certify); + self + } + + pub fn can_certify(&self) -> Option<&bool> { + self.can_certify.as_ref() + } + + pub fn reset_can_certify(&mut self) { + self.can_certify = None; + } + + pub fn set_can_encrypt_comms(&mut self, can_encrypt_comms: bool) { + self.can_encrypt_comms = Some(can_encrypt_comms); + } + + pub fn with_can_encrypt_comms(mut self, can_encrypt_comms: bool) -> GpgKey { + self.can_encrypt_comms = Some(can_encrypt_comms); + self + } + + pub fn can_encrypt_comms(&self) -> Option<&bool> { + self.can_encrypt_comms.as_ref() + } + + pub fn reset_can_encrypt_comms(&mut self) { + self.can_encrypt_comms = None; + } + + pub fn set_can_encrypt_storage(&mut self, can_encrypt_storage: bool) { + self.can_encrypt_storage = Some(can_encrypt_storage); + } + + pub fn with_can_encrypt_storage(mut self, can_encrypt_storage: bool) -> GpgKey { + self.can_encrypt_storage = Some(can_encrypt_storage); + self + } + + pub fn can_encrypt_storage(&self) -> Option<&bool> { + self.can_encrypt_storage.as_ref() + } + + pub fn reset_can_encrypt_storage(&mut self) { + self.can_encrypt_storage = None; + } + + pub fn set_can_sign(&mut self, can_sign: bool) { + self.can_sign = Some(can_sign); + } + + pub fn with_can_sign(mut self, can_sign: bool) -> GpgKey { + self.can_sign = Some(can_sign); + self + } + + pub fn can_sign(&self) -> Option<&bool> { + self.can_sign.as_ref() + } + + pub fn reset_can_sign(&mut self) { + self.can_sign = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> GpgKey { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_emails(&mut self, emails: Vec<::models::GpgKeyEmail>) { + self.emails = Some(emails); + } + + pub fn with_emails(mut self, emails: Vec<::models::GpgKeyEmail>) -> GpgKey { + self.emails = Some(emails); + self + } + + pub fn emails(&self) -> Option<&Vec<::models::GpgKeyEmail>> { + self.emails.as_ref() + } + + pub fn reset_emails(&mut self) { + self.emails = None; + } + + pub fn set_expires_at(&mut self, expires_at: String) { + self.expires_at = Some(expires_at); + } + + pub fn with_expires_at(mut self, expires_at: String) -> GpgKey { + self.expires_at = Some(expires_at); + self + } + + pub fn expires_at(&self) -> Option<&String> { + self.expires_at.as_ref() + } + + pub fn reset_expires_at(&mut self) { + self.expires_at = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> GpgKey { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_key_id(&mut self, key_id: String) { + self.key_id = Some(key_id); + } + + pub fn with_key_id(mut self, key_id: String) -> GpgKey { + self.key_id = Some(key_id); + self + } + + pub fn key_id(&self) -> Option<&String> { + self.key_id.as_ref() + } + + pub fn reset_key_id(&mut self) { + self.key_id = None; + } + + pub fn set_primary_key_id(&mut self, primary_key_id: String) { + self.primary_key_id = Some(primary_key_id); + } + + pub fn with_primary_key_id(mut self, primary_key_id: String) -> GpgKey { + self.primary_key_id = Some(primary_key_id); + self + } + + pub fn primary_key_id(&self) -> Option<&String> { + self.primary_key_id.as_ref() + } + + pub fn reset_primary_key_id(&mut self) { + self.primary_key_id = None; + } + + pub fn set_public_key(&mut self, public_key: String) { + self.public_key = Some(public_key); + } + + pub fn with_public_key(mut self, public_key: String) -> GpgKey { + self.public_key = Some(public_key); + self + } + + pub fn public_key(&self) -> Option<&String> { + self.public_key.as_ref() + } + + pub fn reset_public_key(&mut self) { + self.public_key = None; + } + + pub fn set_subkeys(&mut self, subkeys: Vec<::models::GpgKey>) { + self.subkeys = Some(subkeys); + } + + pub fn with_subkeys(mut self, subkeys: Vec<::models::GpgKey>) -> GpgKey { + self.subkeys = Some(subkeys); + self + } + + pub fn subkeys(&self) -> Option<&Vec<::models::GpgKey>> { + self.subkeys.as_ref() + } + + pub fn reset_subkeys(&mut self) { + self.subkeys = None; + } + +} + + + diff --git a/src/models/gpg_key_email.rs b/src/models/gpg_key_email.rs new file mode 100644 index 0000000..f500168 --- /dev/null +++ b/src/models/gpg_key_email.rs @@ -0,0 +1,70 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// GpgKeyEmail : GPGKeyEmail an email attached to a GPGKey + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GpgKeyEmail { + #[serde(rename = "email")] + email: Option, + #[serde(rename = "verified")] + verified: Option +} + +impl GpgKeyEmail { + /// GPGKeyEmail an email attached to a GPGKey + pub fn new() -> GpgKeyEmail { + GpgKeyEmail { + email: None, + verified: None + } + } + + pub fn set_email(&mut self, email: String) { + self.email = Some(email); + } + + pub fn with_email(mut self, email: String) -> GpgKeyEmail { + self.email = Some(email); + self + } + + pub fn email(&self) -> Option<&String> { + self.email.as_ref() + } + + pub fn reset_email(&mut self) { + self.email = None; + } + + pub fn set_verified(&mut self, verified: bool) { + self.verified = Some(verified); + } + + pub fn with_verified(mut self, verified: bool) -> GpgKeyEmail { + self.verified = Some(verified); + self + } + + pub fn verified(&self) -> Option<&bool> { + self.verified.as_ref() + } + + pub fn reset_verified(&mut self) { + self.verified = None; + } + +} + + + diff --git a/src/models/hook.rs b/src/models/hook.rs new file mode 100644 index 0000000..36e45d4 --- /dev/null +++ b/src/models/hook.rs @@ -0,0 +1,170 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Hook : Hook a hook is a web hook when one repository changed + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Hook { + #[serde(rename = "active")] + active: Option, + #[serde(rename = "config")] + config: Option<::std::collections::HashMap>, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "events")] + events: Option>, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "type")] + _type: Option, + #[serde(rename = "updated_at")] + updated_at: Option +} + +impl Hook { + /// Hook a hook is a web hook when one repository changed + pub fn new() -> Hook { + Hook { + active: None, + config: None, + created_at: None, + events: None, + id: None, + _type: None, + updated_at: None + } + } + + pub fn set_active(&mut self, active: bool) { + self.active = Some(active); + } + + pub fn with_active(mut self, active: bool) -> Hook { + self.active = Some(active); + self + } + + pub fn active(&self) -> Option<&bool> { + self.active.as_ref() + } + + pub fn reset_active(&mut self) { + self.active = None; + } + + pub fn set_config(&mut self, config: ::std::collections::HashMap) { + self.config = Some(config); + } + + pub fn with_config(mut self, config: ::std::collections::HashMap) -> Hook { + self.config = Some(config); + self + } + + pub fn config(&self) -> Option<&::std::collections::HashMap> { + self.config.as_ref() + } + + pub fn reset_config(&mut self) { + self.config = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> Hook { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_events(&mut self, events: Vec) { + self.events = Some(events); + } + + pub fn with_events(mut self, events: Vec) -> Hook { + self.events = Some(events); + self + } + + pub fn events(&self) -> Option<&Vec> { + self.events.as_ref() + } + + pub fn reset_events(&mut self) { + self.events = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Hook { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set__type(&mut self, _type: String) { + self._type = Some(_type); + } + + pub fn with__type(mut self, _type: String) -> Hook { + self._type = Some(_type); + self + } + + pub fn _type(&self) -> Option<&String> { + self._type.as_ref() + } + + pub fn reset__type(&mut self) { + self._type = None; + } + + pub fn set_updated_at(&mut self, updated_at: String) { + self.updated_at = Some(updated_at); + } + + pub fn with_updated_at(mut self, updated_at: String) -> Hook { + self.updated_at = Some(updated_at); + self + } + + pub fn updated_at(&self) -> Option<&String> { + self.updated_at.as_ref() + } + + pub fn reset_updated_at(&mut self) { + self.updated_at = None; + } + +} + + + diff --git a/src/models/identity.rs b/src/models/identity.rs new file mode 100644 index 0000000..023bcf8 --- /dev/null +++ b/src/models/identity.rs @@ -0,0 +1,70 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Identity : Identity for a person's identity like an author or committer + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Identity { + #[serde(rename = "email")] + email: Option, + #[serde(rename = "name")] + name: Option +} + +impl Identity { + /// Identity for a person's identity like an author or committer + pub fn new() -> Identity { + Identity { + email: None, + name: None + } + } + + pub fn set_email(&mut self, email: String) { + self.email = Some(email); + } + + pub fn with_email(mut self, email: String) -> Identity { + self.email = Some(email); + self + } + + pub fn email(&self) -> Option<&String> { + self.email.as_ref() + } + + pub fn reset_email(&mut self) { + self.email = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> Identity { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + +} + + + diff --git a/src/models/inline_response_200.rs b/src/models/inline_response_200.rs new file mode 100644 index 0000000..56214c6 --- /dev/null +++ b/src/models/inline_response_200.rs @@ -0,0 +1,68 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct InlineResponse200 { + #[serde(rename = "data")] + data: Option>, + #[serde(rename = "ok")] + ok: Option +} + +impl InlineResponse200 { + pub fn new() -> InlineResponse200 { + InlineResponse200 { + data: None, + ok: None + } + } + + pub fn set_data(&mut self, data: Vec<::models::Team>) { + self.data = Some(data); + } + + pub fn with_data(mut self, data: Vec<::models::Team>) -> InlineResponse200 { + self.data = Some(data); + self + } + + pub fn data(&self) -> Option<&Vec<::models::Team>> { + self.data.as_ref() + } + + pub fn reset_data(&mut self) { + self.data = None; + } + + pub fn set_ok(&mut self, ok: bool) { + self.ok = Some(ok); + } + + pub fn with_ok(mut self, ok: bool) -> InlineResponse200 { + self.ok = Some(ok); + self + } + + pub fn ok(&self) -> Option<&bool> { + self.ok.as_ref() + } + + pub fn reset_ok(&mut self) { + self.ok = None; + } + +} + + + diff --git a/src/models/inline_response_200_1.rs b/src/models/inline_response_200_1.rs new file mode 100644 index 0000000..df937fc --- /dev/null +++ b/src/models/inline_response_200_1.rs @@ -0,0 +1,68 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct InlineResponse2001 { + #[serde(rename = "data")] + data: Option>, + #[serde(rename = "ok")] + ok: Option +} + +impl InlineResponse2001 { + pub fn new() -> InlineResponse2001 { + InlineResponse2001 { + data: None, + ok: None + } + } + + pub fn set_data(&mut self, data: Vec<::models::User>) { + self.data = Some(data); + } + + pub fn with_data(mut self, data: Vec<::models::User>) -> InlineResponse2001 { + self.data = Some(data); + self + } + + pub fn data(&self) -> Option<&Vec<::models::User>> { + self.data.as_ref() + } + + pub fn reset_data(&mut self) { + self.data = None; + } + + pub fn set_ok(&mut self, ok: bool) { + self.ok = Some(ok); + } + + pub fn with_ok(mut self, ok: bool) -> InlineResponse2001 { + self.ok = Some(ok); + self + } + + pub fn ok(&self) -> Option<&bool> { + self.ok.as_ref() + } + + pub fn reset_ok(&mut self) { + self.ok = None; + } + +} + + + diff --git a/src/models/internal_tracker.rs b/src/models/internal_tracker.rs new file mode 100644 index 0000000..b462bb7 --- /dev/null +++ b/src/models/internal_tracker.rs @@ -0,0 +1,93 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// InternalTracker : InternalTracker represents settings for internal tracker + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct InternalTracker { + /// Let only contributors track time (Built-in issue tracker) + #[serde(rename = "allow_only_contributors_to_track_time")] + allow_only_contributors_to_track_time: Option, + /// Enable dependencies for issues and pull requests (Built-in issue tracker) + #[serde(rename = "enable_issue_dependencies")] + enable_issue_dependencies: Option, + /// Enable time tracking (Built-in issue tracker) + #[serde(rename = "enable_time_tracker")] + enable_time_tracker: Option +} + +impl InternalTracker { + /// InternalTracker represents settings for internal tracker + pub fn new() -> InternalTracker { + InternalTracker { + allow_only_contributors_to_track_time: None, + enable_issue_dependencies: None, + enable_time_tracker: None + } + } + + pub fn set_allow_only_contributors_to_track_time(&mut self, allow_only_contributors_to_track_time: bool) { + self.allow_only_contributors_to_track_time = Some(allow_only_contributors_to_track_time); + } + + pub fn with_allow_only_contributors_to_track_time(mut self, allow_only_contributors_to_track_time: bool) -> InternalTracker { + self.allow_only_contributors_to_track_time = Some(allow_only_contributors_to_track_time); + self + } + + pub fn allow_only_contributors_to_track_time(&self) -> Option<&bool> { + self.allow_only_contributors_to_track_time.as_ref() + } + + pub fn reset_allow_only_contributors_to_track_time(&mut self) { + self.allow_only_contributors_to_track_time = None; + } + + pub fn set_enable_issue_dependencies(&mut self, enable_issue_dependencies: bool) { + self.enable_issue_dependencies = Some(enable_issue_dependencies); + } + + pub fn with_enable_issue_dependencies(mut self, enable_issue_dependencies: bool) -> InternalTracker { + self.enable_issue_dependencies = Some(enable_issue_dependencies); + self + } + + pub fn enable_issue_dependencies(&self) -> Option<&bool> { + self.enable_issue_dependencies.as_ref() + } + + pub fn reset_enable_issue_dependencies(&mut self) { + self.enable_issue_dependencies = None; + } + + pub fn set_enable_time_tracker(&mut self, enable_time_tracker: bool) { + self.enable_time_tracker = Some(enable_time_tracker); + } + + pub fn with_enable_time_tracker(mut self, enable_time_tracker: bool) -> InternalTracker { + self.enable_time_tracker = Some(enable_time_tracker); + self + } + + pub fn enable_time_tracker(&self) -> Option<&bool> { + self.enable_time_tracker.as_ref() + } + + pub fn reset_enable_time_tracker(&mut self) { + self.enable_time_tracker = None; + } + +} + + + diff --git a/src/models/issue.rs b/src/models/issue.rs new file mode 100644 index 0000000..41fa8ff --- /dev/null +++ b/src/models/issue.rs @@ -0,0 +1,450 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Issue : Issue represents an issue in a repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Issue { + #[serde(rename = "assignee")] + assignee: Option<::models::User>, + #[serde(rename = "assignees")] + assignees: Option>, + #[serde(rename = "body")] + body: Option, + #[serde(rename = "closed_at")] + closed_at: Option, + #[serde(rename = "comments")] + comments: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "due_date")] + due_date: Option, + #[serde(rename = "html_url")] + html_url: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "labels")] + labels: Option>, + #[serde(rename = "milestone")] + milestone: Option<::models::Milestone>, + #[serde(rename = "number")] + number: Option, + #[serde(rename = "original_author")] + original_author: Option, + #[serde(rename = "original_author_id")] + original_author_id: Option, + #[serde(rename = "pull_request")] + pull_request: Option<::models::PullRequestMeta>, + #[serde(rename = "repository")] + repository: Option<::models::RepositoryMeta>, + #[serde(rename = "state")] + state: Option<::models::StateType>, + #[serde(rename = "title")] + title: Option, + #[serde(rename = "updated_at")] + updated_at: Option, + #[serde(rename = "url")] + url: Option, + #[serde(rename = "user")] + user: Option<::models::User> +} + +impl Issue { + /// Issue represents an issue in a repository + pub fn new() -> Issue { + Issue { + assignee: None, + assignees: None, + body: None, + closed_at: None, + comments: None, + created_at: None, + due_date: None, + html_url: None, + id: None, + labels: None, + milestone: None, + number: None, + original_author: None, + original_author_id: None, + pull_request: None, + repository: None, + state: None, + title: None, + updated_at: None, + url: None, + user: None + } + } + + pub fn set_assignee(&mut self, assignee: ::models::User) { + self.assignee = Some(assignee); + } + + pub fn with_assignee(mut self, assignee: ::models::User) -> Issue { + self.assignee = Some(assignee); + self + } + + pub fn assignee(&self) -> Option<&::models::User> { + self.assignee.as_ref() + } + + pub fn reset_assignee(&mut self) { + self.assignee = None; + } + + pub fn set_assignees(&mut self, assignees: Vec<::models::User>) { + self.assignees = Some(assignees); + } + + pub fn with_assignees(mut self, assignees: Vec<::models::User>) -> Issue { + self.assignees = Some(assignees); + self + } + + pub fn assignees(&self) -> Option<&Vec<::models::User>> { + self.assignees.as_ref() + } + + pub fn reset_assignees(&mut self) { + self.assignees = None; + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> Issue { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_closed_at(&mut self, closed_at: String) { + self.closed_at = Some(closed_at); + } + + pub fn with_closed_at(mut self, closed_at: String) -> Issue { + self.closed_at = Some(closed_at); + self + } + + pub fn closed_at(&self) -> Option<&String> { + self.closed_at.as_ref() + } + + pub fn reset_closed_at(&mut self) { + self.closed_at = None; + } + + pub fn set_comments(&mut self, comments: i64) { + self.comments = Some(comments); + } + + pub fn with_comments(mut self, comments: i64) -> Issue { + self.comments = Some(comments); + self + } + + pub fn comments(&self) -> Option<&i64> { + self.comments.as_ref() + } + + pub fn reset_comments(&mut self) { + self.comments = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> Issue { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_due_date(&mut self, due_date: String) { + self.due_date = Some(due_date); + } + + pub fn with_due_date(mut self, due_date: String) -> Issue { + self.due_date = Some(due_date); + self + } + + pub fn due_date(&self) -> Option<&String> { + self.due_date.as_ref() + } + + pub fn reset_due_date(&mut self) { + self.due_date = None; + } + + pub fn set_html_url(&mut self, html_url: String) { + self.html_url = Some(html_url); + } + + pub fn with_html_url(mut self, html_url: String) -> Issue { + self.html_url = Some(html_url); + self + } + + pub fn html_url(&self) -> Option<&String> { + self.html_url.as_ref() + } + + pub fn reset_html_url(&mut self) { + self.html_url = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Issue { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_labels(&mut self, labels: Vec<::models::Label>) { + self.labels = Some(labels); + } + + pub fn with_labels(mut self, labels: Vec<::models::Label>) -> Issue { + self.labels = Some(labels); + self + } + + pub fn labels(&self) -> Option<&Vec<::models::Label>> { + self.labels.as_ref() + } + + pub fn reset_labels(&mut self) { + self.labels = None; + } + + pub fn set_milestone(&mut self, milestone: ::models::Milestone) { + self.milestone = Some(milestone); + } + + pub fn with_milestone(mut self, milestone: ::models::Milestone) -> Issue { + self.milestone = Some(milestone); + self + } + + pub fn milestone(&self) -> Option<&::models::Milestone> { + self.milestone.as_ref() + } + + pub fn reset_milestone(&mut self) { + self.milestone = None; + } + + pub fn set_number(&mut self, number: i64) { + self.number = Some(number); + } + + pub fn with_number(mut self, number: i64) -> Issue { + self.number = Some(number); + self + } + + pub fn number(&self) -> Option<&i64> { + self.number.as_ref() + } + + pub fn reset_number(&mut self) { + self.number = None; + } + + pub fn set_original_author(&mut self, original_author: String) { + self.original_author = Some(original_author); + } + + pub fn with_original_author(mut self, original_author: String) -> Issue { + self.original_author = Some(original_author); + self + } + + pub fn original_author(&self) -> Option<&String> { + self.original_author.as_ref() + } + + pub fn reset_original_author(&mut self) { + self.original_author = None; + } + + pub fn set_original_author_id(&mut self, original_author_id: i64) { + self.original_author_id = Some(original_author_id); + } + + pub fn with_original_author_id(mut self, original_author_id: i64) -> Issue { + self.original_author_id = Some(original_author_id); + self + } + + pub fn original_author_id(&self) -> Option<&i64> { + self.original_author_id.as_ref() + } + + pub fn reset_original_author_id(&mut self) { + self.original_author_id = None; + } + + pub fn set_pull_request(&mut self, pull_request: ::models::PullRequestMeta) { + self.pull_request = Some(pull_request); + } + + pub fn with_pull_request(mut self, pull_request: ::models::PullRequestMeta) -> Issue { + self.pull_request = Some(pull_request); + self + } + + pub fn pull_request(&self) -> Option<&::models::PullRequestMeta> { + self.pull_request.as_ref() + } + + pub fn reset_pull_request(&mut self) { + self.pull_request = None; + } + + pub fn set_repository(&mut self, repository: ::models::RepositoryMeta) { + self.repository = Some(repository); + } + + pub fn with_repository(mut self, repository: ::models::RepositoryMeta) -> Issue { + self.repository = Some(repository); + self + } + + pub fn repository(&self) -> Option<&::models::RepositoryMeta> { + self.repository.as_ref() + } + + pub fn reset_repository(&mut self) { + self.repository = None; + } + + pub fn set_state(&mut self, state: ::models::StateType) { + self.state = Some(state); + } + + pub fn with_state(mut self, state: ::models::StateType) -> Issue { + self.state = Some(state); + self + } + + pub fn state(&self) -> Option<&::models::StateType> { + self.state.as_ref() + } + + pub fn reset_state(&mut self) { + self.state = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> Issue { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + + pub fn set_updated_at(&mut self, updated_at: String) { + self.updated_at = Some(updated_at); + } + + pub fn with_updated_at(mut self, updated_at: String) -> Issue { + self.updated_at = Some(updated_at); + self + } + + pub fn updated_at(&self) -> Option<&String> { + self.updated_at.as_ref() + } + + pub fn reset_updated_at(&mut self) { + self.updated_at = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> Issue { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + + pub fn set_user(&mut self, user: ::models::User) { + self.user = Some(user); + } + + pub fn with_user(mut self, user: ::models::User) -> Issue { + self.user = Some(user); + self + } + + pub fn user(&self) -> Option<&::models::User> { + self.user.as_ref() + } + + pub fn reset_user(&mut self) { + self.user = None; + } + +} + + + diff --git a/src/models/issue_deadline.rs b/src/models/issue_deadline.rs new file mode 100644 index 0000000..896de6f --- /dev/null +++ b/src/models/issue_deadline.rs @@ -0,0 +1,50 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// IssueDeadline : IssueDeadline represents an issue deadline + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct IssueDeadline { + #[serde(rename = "due_date")] + due_date: Option +} + +impl IssueDeadline { + /// IssueDeadline represents an issue deadline + pub fn new() -> IssueDeadline { + IssueDeadline { + due_date: None + } + } + + pub fn set_due_date(&mut self, due_date: String) { + self.due_date = Some(due_date); + } + + pub fn with_due_date(mut self, due_date: String) -> IssueDeadline { + self.due_date = Some(due_date); + self + } + + pub fn due_date(&self) -> Option<&String> { + self.due_date.as_ref() + } + + pub fn reset_due_date(&mut self) { + self.due_date = None; + } + +} + + + diff --git a/src/models/issue_labels_option.rs b/src/models/issue_labels_option.rs new file mode 100644 index 0000000..b6492c5 --- /dev/null +++ b/src/models/issue_labels_option.rs @@ -0,0 +1,51 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// IssueLabelsOption : IssueLabelsOption a collection of labels + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct IssueLabelsOption { + /// list of label IDs + #[serde(rename = "labels")] + labels: Option> +} + +impl IssueLabelsOption { + /// IssueLabelsOption a collection of labels + pub fn new() -> IssueLabelsOption { + IssueLabelsOption { + labels: None + } + } + + pub fn set_labels(&mut self, labels: Vec) { + self.labels = Some(labels); + } + + pub fn with_labels(mut self, labels: Vec) -> IssueLabelsOption { + self.labels = Some(labels); + self + } + + pub fn labels(&self) -> Option<&Vec> { + self.labels.as_ref() + } + + pub fn reset_labels(&mut self) { + self.labels = None; + } + +} + + + diff --git a/src/models/label.rs b/src/models/label.rs new file mode 100644 index 0000000..2705e31 --- /dev/null +++ b/src/models/label.rs @@ -0,0 +1,130 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Label : Label a label to an issue or a pr + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Label { + #[serde(rename = "color")] + color: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "url")] + url: Option +} + +impl Label { + /// Label a label to an issue or a pr + pub fn new() -> Label { + Label { + color: None, + description: None, + id: None, + name: None, + url: None + } + } + + pub fn set_color(&mut self, color: String) { + self.color = Some(color); + } + + pub fn with_color(mut self, color: String) -> Label { + self.color = Some(color); + self + } + + pub fn color(&self) -> Option<&String> { + self.color.as_ref() + } + + pub fn reset_color(&mut self) { + self.color = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> Label { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Label { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> Label { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> Label { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/markdown_option.rs b/src/models/markdown_option.rs new file mode 100644 index 0000000..f88b7c5 --- /dev/null +++ b/src/models/markdown_option.rs @@ -0,0 +1,114 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// MarkdownOption : MarkdownOption markdown options + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct MarkdownOption { + /// Context to render in: body + #[serde(rename = "Context")] + context: Option, + /// Mode to render in: body + #[serde(rename = "Mode")] + mode: Option, + /// Text markdown to render in: body + #[serde(rename = "Text")] + text: Option, + /// Is it a wiki page ? in: body + #[serde(rename = "Wiki")] + wiki: Option +} + +impl MarkdownOption { + /// MarkdownOption markdown options + pub fn new() -> MarkdownOption { + MarkdownOption { + context: None, + mode: None, + text: None, + wiki: None + } + } + + pub fn set_context(&mut self, context: String) { + self.context = Some(context); + } + + pub fn with_context(mut self, context: String) -> MarkdownOption { + self.context = Some(context); + self + } + + pub fn context(&self) -> Option<&String> { + self.context.as_ref() + } + + pub fn reset_context(&mut self) { + self.context = None; + } + + pub fn set_mode(&mut self, mode: String) { + self.mode = Some(mode); + } + + pub fn with_mode(mut self, mode: String) -> MarkdownOption { + self.mode = Some(mode); + self + } + + pub fn mode(&self) -> Option<&String> { + self.mode.as_ref() + } + + pub fn reset_mode(&mut self) { + self.mode = None; + } + + pub fn set_text(&mut self, text: String) { + self.text = Some(text); + } + + pub fn with_text(mut self, text: String) -> MarkdownOption { + self.text = Some(text); + self + } + + pub fn text(&self) -> Option<&String> { + self.text.as_ref() + } + + pub fn reset_text(&mut self) { + self.text = None; + } + + pub fn set_wiki(&mut self, wiki: bool) { + self.wiki = Some(wiki); + } + + pub fn with_wiki(mut self, wiki: bool) -> MarkdownOption { + self.wiki = Some(wiki); + self + } + + pub fn wiki(&self) -> Option<&bool> { + self.wiki.as_ref() + } + + pub fn reset_wiki(&mut self) { + self.wiki = None; + } + +} + + + diff --git a/src/models/merge_pull_request_option.rs b/src/models/merge_pull_request_option.rs new file mode 100644 index 0000000..581be53 --- /dev/null +++ b/src/models/merge_pull_request_option.rs @@ -0,0 +1,87 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// MergePullRequestOption : MergePullRequestForm form for merging Pull Request + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct MergePullRequestOption { + #[serde(rename = "Do")] + _do: String, + #[serde(rename = "MergeMessageField")] + merge_message_field: Option, + #[serde(rename = "MergeTitleField")] + merge_title_field: Option +} + +impl MergePullRequestOption { + /// MergePullRequestForm form for merging Pull Request + pub fn new(_do: String) -> MergePullRequestOption { + MergePullRequestOption { + _do: _do, + merge_message_field: None, + merge_title_field: None + } + } + + pub fn set__do(&mut self, _do: String) { + self._do = _do; + } + + pub fn with__do(mut self, _do: String) -> MergePullRequestOption { + self._do = _do; + self + } + + pub fn _do(&self) -> &String { + &self._do + } + + + pub fn set_merge_message_field(&mut self, merge_message_field: String) { + self.merge_message_field = Some(merge_message_field); + } + + pub fn with_merge_message_field(mut self, merge_message_field: String) -> MergePullRequestOption { + self.merge_message_field = Some(merge_message_field); + self + } + + pub fn merge_message_field(&self) -> Option<&String> { + self.merge_message_field.as_ref() + } + + pub fn reset_merge_message_field(&mut self) { + self.merge_message_field = None; + } + + pub fn set_merge_title_field(&mut self, merge_title_field: String) { + self.merge_title_field = Some(merge_title_field); + } + + pub fn with_merge_title_field(mut self, merge_title_field: String) -> MergePullRequestOption { + self.merge_title_field = Some(merge_title_field); + self + } + + pub fn merge_title_field(&self) -> Option<&String> { + self.merge_title_field.as_ref() + } + + pub fn reset_merge_title_field(&mut self) { + self.merge_title_field = None; + } + +} + + + diff --git a/src/models/migrate_repo_form.rs b/src/models/migrate_repo_form.rs new file mode 100644 index 0000000..9d3cafd --- /dev/null +++ b/src/models/migrate_repo_form.rs @@ -0,0 +1,301 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// MigrateRepoForm : MigrateRepoForm form for migrating repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct MigrateRepoForm { + #[serde(rename = "auth_password")] + auth_password: Option, + #[serde(rename = "auth_username")] + auth_username: Option, + #[serde(rename = "clone_addr")] + clone_addr: String, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "issues")] + issues: Option, + #[serde(rename = "labels")] + labels: Option, + #[serde(rename = "milestones")] + milestones: Option, + #[serde(rename = "mirror")] + mirror: Option, + #[serde(rename = "private")] + private: Option, + #[serde(rename = "pull_requests")] + pull_requests: Option, + #[serde(rename = "releases")] + releases: Option, + #[serde(rename = "repo_name")] + repo_name: String, + #[serde(rename = "uid")] + uid: i64, + #[serde(rename = "wiki")] + wiki: Option +} + +impl MigrateRepoForm { + /// MigrateRepoForm form for migrating repository + pub fn new(clone_addr: String, repo_name: String, uid: i64) -> MigrateRepoForm { + MigrateRepoForm { + auth_password: None, + auth_username: None, + clone_addr: clone_addr, + description: None, + issues: None, + labels: None, + milestones: None, + mirror: None, + private: None, + pull_requests: None, + releases: None, + repo_name: repo_name, + uid: uid, + wiki: None + } + } + + pub fn set_auth_password(&mut self, auth_password: String) { + self.auth_password = Some(auth_password); + } + + pub fn with_auth_password(mut self, auth_password: String) -> MigrateRepoForm { + self.auth_password = Some(auth_password); + self + } + + pub fn auth_password(&self) -> Option<&String> { + self.auth_password.as_ref() + } + + pub fn reset_auth_password(&mut self) { + self.auth_password = None; + } + + pub fn set_auth_username(&mut self, auth_username: String) { + self.auth_username = Some(auth_username); + } + + pub fn with_auth_username(mut self, auth_username: String) -> MigrateRepoForm { + self.auth_username = Some(auth_username); + self + } + + pub fn auth_username(&self) -> Option<&String> { + self.auth_username.as_ref() + } + + pub fn reset_auth_username(&mut self) { + self.auth_username = None; + } + + pub fn set_clone_addr(&mut self, clone_addr: String) { + self.clone_addr = clone_addr; + } + + pub fn with_clone_addr(mut self, clone_addr: String) -> MigrateRepoForm { + self.clone_addr = clone_addr; + self + } + + pub fn clone_addr(&self) -> &String { + &self.clone_addr + } + + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> MigrateRepoForm { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_issues(&mut self, issues: bool) { + self.issues = Some(issues); + } + + pub fn with_issues(mut self, issues: bool) -> MigrateRepoForm { + self.issues = Some(issues); + self + } + + pub fn issues(&self) -> Option<&bool> { + self.issues.as_ref() + } + + pub fn reset_issues(&mut self) { + self.issues = None; + } + + pub fn set_labels(&mut self, labels: bool) { + self.labels = Some(labels); + } + + pub fn with_labels(mut self, labels: bool) -> MigrateRepoForm { + self.labels = Some(labels); + self + } + + pub fn labels(&self) -> Option<&bool> { + self.labels.as_ref() + } + + pub fn reset_labels(&mut self) { + self.labels = None; + } + + pub fn set_milestones(&mut self, milestones: bool) { + self.milestones = Some(milestones); + } + + pub fn with_milestones(mut self, milestones: bool) -> MigrateRepoForm { + self.milestones = Some(milestones); + self + } + + pub fn milestones(&self) -> Option<&bool> { + self.milestones.as_ref() + } + + pub fn reset_milestones(&mut self) { + self.milestones = None; + } + + pub fn set_mirror(&mut self, mirror: bool) { + self.mirror = Some(mirror); + } + + pub fn with_mirror(mut self, mirror: bool) -> MigrateRepoForm { + self.mirror = Some(mirror); + self + } + + pub fn mirror(&self) -> Option<&bool> { + self.mirror.as_ref() + } + + pub fn reset_mirror(&mut self) { + self.mirror = None; + } + + pub fn set_private(&mut self, private: bool) { + self.private = Some(private); + } + + pub fn with_private(mut self, private: bool) -> MigrateRepoForm { + self.private = Some(private); + self + } + + pub fn private(&self) -> Option<&bool> { + self.private.as_ref() + } + + pub fn reset_private(&mut self) { + self.private = None; + } + + pub fn set_pull_requests(&mut self, pull_requests: bool) { + self.pull_requests = Some(pull_requests); + } + + pub fn with_pull_requests(mut self, pull_requests: bool) -> MigrateRepoForm { + self.pull_requests = Some(pull_requests); + self + } + + pub fn pull_requests(&self) -> Option<&bool> { + self.pull_requests.as_ref() + } + + pub fn reset_pull_requests(&mut self) { + self.pull_requests = None; + } + + pub fn set_releases(&mut self, releases: bool) { + self.releases = Some(releases); + } + + pub fn with_releases(mut self, releases: bool) -> MigrateRepoForm { + self.releases = Some(releases); + self + } + + pub fn releases(&self) -> Option<&bool> { + self.releases.as_ref() + } + + pub fn reset_releases(&mut self) { + self.releases = None; + } + + pub fn set_repo_name(&mut self, repo_name: String) { + self.repo_name = repo_name; + } + + pub fn with_repo_name(mut self, repo_name: String) -> MigrateRepoForm { + self.repo_name = repo_name; + self + } + + pub fn repo_name(&self) -> &String { + &self.repo_name + } + + + pub fn set_uid(&mut self, uid: i64) { + self.uid = uid; + } + + pub fn with_uid(mut self, uid: i64) -> MigrateRepoForm { + self.uid = uid; + self + } + + pub fn uid(&self) -> &i64 { + &self.uid + } + + + pub fn set_wiki(&mut self, wiki: bool) { + self.wiki = Some(wiki); + } + + pub fn with_wiki(mut self, wiki: bool) -> MigrateRepoForm { + self.wiki = Some(wiki); + self + } + + pub fn wiki(&self) -> Option<&bool> { + self.wiki.as_ref() + } + + pub fn reset_wiki(&mut self) { + self.wiki = None; + } + +} + + + diff --git a/src/models/milestone.rs b/src/models/milestone.rs new file mode 100644 index 0000000..6b516be --- /dev/null +++ b/src/models/milestone.rs @@ -0,0 +1,190 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Milestone : Milestone milestone is a collection of issues on one repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Milestone { + #[serde(rename = "closed_at")] + closed_at: Option, + #[serde(rename = "closed_issues")] + closed_issues: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "due_on")] + due_on: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "open_issues")] + open_issues: Option, + #[serde(rename = "state")] + state: Option<::models::StateType>, + #[serde(rename = "title")] + title: Option +} + +impl Milestone { + /// Milestone milestone is a collection of issues on one repository + pub fn new() -> Milestone { + Milestone { + closed_at: None, + closed_issues: None, + description: None, + due_on: None, + id: None, + open_issues: None, + state: None, + title: None + } + } + + pub fn set_closed_at(&mut self, closed_at: String) { + self.closed_at = Some(closed_at); + } + + pub fn with_closed_at(mut self, closed_at: String) -> Milestone { + self.closed_at = Some(closed_at); + self + } + + pub fn closed_at(&self) -> Option<&String> { + self.closed_at.as_ref() + } + + pub fn reset_closed_at(&mut self) { + self.closed_at = None; + } + + pub fn set_closed_issues(&mut self, closed_issues: i64) { + self.closed_issues = Some(closed_issues); + } + + pub fn with_closed_issues(mut self, closed_issues: i64) -> Milestone { + self.closed_issues = Some(closed_issues); + self + } + + pub fn closed_issues(&self) -> Option<&i64> { + self.closed_issues.as_ref() + } + + pub fn reset_closed_issues(&mut self) { + self.closed_issues = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> Milestone { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_due_on(&mut self, due_on: String) { + self.due_on = Some(due_on); + } + + pub fn with_due_on(mut self, due_on: String) -> Milestone { + self.due_on = Some(due_on); + self + } + + pub fn due_on(&self) -> Option<&String> { + self.due_on.as_ref() + } + + pub fn reset_due_on(&mut self) { + self.due_on = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Milestone { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_open_issues(&mut self, open_issues: i64) { + self.open_issues = Some(open_issues); + } + + pub fn with_open_issues(mut self, open_issues: i64) -> Milestone { + self.open_issues = Some(open_issues); + self + } + + pub fn open_issues(&self) -> Option<&i64> { + self.open_issues.as_ref() + } + + pub fn reset_open_issues(&mut self) { + self.open_issues = None; + } + + pub fn set_state(&mut self, state: ::models::StateType) { + self.state = Some(state); + } + + pub fn with_state(mut self, state: ::models::StateType) -> Milestone { + self.state = Some(state); + self + } + + pub fn state(&self) -> Option<&::models::StateType> { + self.state.as_ref() + } + + pub fn reset_state(&mut self) { + self.state = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> Milestone { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + +} + + + diff --git a/src/models/mod.rs b/src/models/mod.rs new file mode 100644 index 0000000..6b93f1e --- /dev/null +++ b/src/models/mod.rs @@ -0,0 +1,221 @@ +mod access_token; +pub use self::access_token::AccessToken; +mod add_collaborator_option; +pub use self::add_collaborator_option::AddCollaboratorOption; +mod add_time_option; +pub use self::add_time_option::AddTimeOption; +mod annotated_tag; +pub use self::annotated_tag::AnnotatedTag; +mod annotated_tag_object; +pub use self::annotated_tag_object::AnnotatedTagObject; +mod api_error; +pub use self::api_error::ApiError; +mod attachment; +pub use self::attachment::Attachment; +mod branch; +pub use self::branch::Branch; +mod comment; +pub use self::comment::Comment; +mod commit; +pub use self::commit::Commit; +mod commit_date_options; +pub use self::commit_date_options::CommitDateOptions; +mod commit_meta; +pub use self::commit_meta::CommitMeta; +mod commit_user; +pub use self::commit_user::CommitUser; +mod contents_response; +pub use self::contents_response::ContentsResponse; +mod create_email_option; +pub use self::create_email_option::CreateEmailOption; +mod create_file_options; +pub use self::create_file_options::CreateFileOptions; +mod create_fork_option; +pub use self::create_fork_option::CreateForkOption; +mod create_gpg_key_option; +pub use self::create_gpg_key_option::CreateGpgKeyOption; +mod create_hook_option; +pub use self::create_hook_option::CreateHookOption; +mod create_hook_option_config; +pub use self::create_hook_option_config::CreateHookOptionConfig; +mod create_issue_comment_option; +pub use self::create_issue_comment_option::CreateIssueCommentOption; +mod create_issue_option; +pub use self::create_issue_option::CreateIssueOption; +mod create_key_option; +pub use self::create_key_option::CreateKeyOption; +mod create_label_option; +pub use self::create_label_option::CreateLabelOption; +mod create_milestone_option; +pub use self::create_milestone_option::CreateMilestoneOption; +mod create_org_option; +pub use self::create_org_option::CreateOrgOption; +mod create_pull_request_option; +pub use self::create_pull_request_option::CreatePullRequestOption; +mod create_release_option; +pub use self::create_release_option::CreateReleaseOption; +mod create_repo_option; +pub use self::create_repo_option::CreateRepoOption; +mod create_status_option; +pub use self::create_status_option::CreateStatusOption; +mod create_team_option; +pub use self::create_team_option::CreateTeamOption; +mod create_user_option; +pub use self::create_user_option::CreateUserOption; +mod delete_email_option; +pub use self::delete_email_option::DeleteEmailOption; +mod delete_file_options; +pub use self::delete_file_options::DeleteFileOptions; +mod deploy_key; +pub use self::deploy_key::DeployKey; +mod edit_attachment_options; +pub use self::edit_attachment_options::EditAttachmentOptions; +mod edit_deadline_option; +pub use self::edit_deadline_option::EditDeadlineOption; +mod edit_git_hook_option; +pub use self::edit_git_hook_option::EditGitHookOption; +mod edit_hook_option; +pub use self::edit_hook_option::EditHookOption; +mod edit_issue_comment_option; +pub use self::edit_issue_comment_option::EditIssueCommentOption; +mod edit_issue_option; +pub use self::edit_issue_option::EditIssueOption; +mod edit_label_option; +pub use self::edit_label_option::EditLabelOption; +mod edit_milestone_option; +pub use self::edit_milestone_option::EditMilestoneOption; +mod edit_org_option; +pub use self::edit_org_option::EditOrgOption; +mod edit_pull_request_option; +pub use self::edit_pull_request_option::EditPullRequestOption; +mod edit_reaction_option; +pub use self::edit_reaction_option::EditReactionOption; +mod edit_release_option; +pub use self::edit_release_option::EditReleaseOption; +mod edit_repo_option; +pub use self::edit_repo_option::EditRepoOption; +mod edit_team_option; +pub use self::edit_team_option::EditTeamOption; +mod edit_user_option; +pub use self::edit_user_option::EditUserOption; +mod email; +pub use self::email::Email; +mod external_tracker; +pub use self::external_tracker::ExternalTracker; +mod external_wiki; +pub use self::external_wiki::ExternalWiki; +mod file_commit_response; +pub use self::file_commit_response::FileCommitResponse; +mod file_delete_response; +pub use self::file_delete_response::FileDeleteResponse; +mod file_links_response; +pub use self::file_links_response::FileLinksResponse; +mod file_response; +pub use self::file_response::FileResponse; +mod git_blob_response; +pub use self::git_blob_response::GitBlobResponse; +mod git_entry; +pub use self::git_entry::GitEntry; +mod git_hook; +pub use self::git_hook::GitHook; +mod git_object; +pub use self::git_object::GitObject; +mod git_tree_response; +pub use self::git_tree_response::GitTreeResponse; +mod gpg_key; +pub use self::gpg_key::GpgKey; +mod gpg_key_email; +pub use self::gpg_key_email::GpgKeyEmail; +mod hook; +pub use self::hook::Hook; +mod identity; +pub use self::identity::Identity; +mod inline_response_200; +pub use self::inline_response_200::InlineResponse200; +mod inline_response_200_1; +pub use self::inline_response_200_1::InlineResponse2001; +mod internal_tracker; +pub use self::internal_tracker::InternalTracker; +mod issue; +pub use self::issue::Issue; +mod issue_deadline; +pub use self::issue_deadline::IssueDeadline; +mod issue_labels_option; +pub use self::issue_labels_option::IssueLabelsOption; +mod label; +pub use self::label::Label; +mod markdown_option; +pub use self::markdown_option::MarkdownOption; +mod merge_pull_request_option; +pub use self::merge_pull_request_option::MergePullRequestOption; +mod migrate_repo_form; +pub use self::migrate_repo_form::MigrateRepoForm; +mod milestone; +pub use self::milestone::Milestone; +mod organization; +pub use self::organization::Organization; +mod payload_commit; +pub use self::payload_commit::PayloadCommit; +mod payload_commit_verification; +pub use self::payload_commit_verification::PayloadCommitVerification; +mod payload_user; +pub use self::payload_user::PayloadUser; +mod permission; +pub use self::permission::Permission; +mod pr_branch_info; +pub use self::pr_branch_info::PrBranchInfo; +mod public_key; +pub use self::public_key::PublicKey; +mod pull_request; +pub use self::pull_request::PullRequest; +mod pull_request_meta; +pub use self::pull_request_meta::PullRequestMeta; +mod reaction; +pub use self::reaction::Reaction; +mod reference; +pub use self::reference::Reference; +mod release; +pub use self::release::Release; +mod repo_commit; +pub use self::repo_commit::RepoCommit; +mod repo_topic_options; +pub use self::repo_topic_options::RepoTopicOptions; +mod repository; +pub use self::repository::Repository; +mod repository_meta; +pub use self::repository_meta::RepositoryMeta; +mod search_results; +pub use self::search_results::SearchResults; +mod server_version; +pub use self::server_version::ServerVersion; +mod state_type; +pub use self::state_type::StateType; +mod status; +pub use self::status::Status; +mod status_state; +pub use self::status_state::StatusState; +mod stop_watch; +pub use self::stop_watch::StopWatch; +mod tag; +pub use self::tag::Tag; +mod team; +pub use self::team::Team; +mod time_stamp; +pub use self::time_stamp::TimeStamp; +mod topic_name; +pub use self::topic_name::TopicName; +mod topic_response; +pub use self::topic_response::TopicResponse; +mod tracked_time; +pub use self::tracked_time::TrackedTime; +mod update_file_options; +pub use self::update_file_options::UpdateFileOptions; +mod user; +pub use self::user::User; +mod user_heatmap_data; +pub use self::user_heatmap_data::UserHeatmapData; +mod watch_info; +pub use self::watch_info::WatchInfo; + +// TODO(farcaller): sort out files +pub struct File; diff --git a/src/models/organization.rs b/src/models/organization.rs new file mode 100644 index 0000000..f6797a0 --- /dev/null +++ b/src/models/organization.rs @@ -0,0 +1,210 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Organization : Organization represents an organization + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Organization { + #[serde(rename = "avatar_url")] + avatar_url: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "full_name")] + full_name: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "location")] + location: Option, + #[serde(rename = "repo_admin_change_team_access")] + repo_admin_change_team_access: Option, + #[serde(rename = "username")] + username: Option, + #[serde(rename = "visibility")] + visibility: Option, + #[serde(rename = "website")] + website: Option +} + +impl Organization { + /// Organization represents an organization + pub fn new() -> Organization { + Organization { + avatar_url: None, + description: None, + full_name: None, + id: None, + location: None, + repo_admin_change_team_access: None, + username: None, + visibility: None, + website: None + } + } + + pub fn set_avatar_url(&mut self, avatar_url: String) { + self.avatar_url = Some(avatar_url); + } + + pub fn with_avatar_url(mut self, avatar_url: String) -> Organization { + self.avatar_url = Some(avatar_url); + self + } + + pub fn avatar_url(&self) -> Option<&String> { + self.avatar_url.as_ref() + } + + pub fn reset_avatar_url(&mut self) { + self.avatar_url = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> Organization { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_full_name(&mut self, full_name: String) { + self.full_name = Some(full_name); + } + + pub fn with_full_name(mut self, full_name: String) -> Organization { + self.full_name = Some(full_name); + self + } + + pub fn full_name(&self) -> Option<&String> { + self.full_name.as_ref() + } + + pub fn reset_full_name(&mut self) { + self.full_name = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Organization { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_location(&mut self, location: String) { + self.location = Some(location); + } + + pub fn with_location(mut self, location: String) -> Organization { + self.location = Some(location); + self + } + + pub fn location(&self) -> Option<&String> { + self.location.as_ref() + } + + pub fn reset_location(&mut self) { + self.location = None; + } + + pub fn set_repo_admin_change_team_access(&mut self, repo_admin_change_team_access: bool) { + self.repo_admin_change_team_access = Some(repo_admin_change_team_access); + } + + pub fn with_repo_admin_change_team_access(mut self, repo_admin_change_team_access: bool) -> Organization { + self.repo_admin_change_team_access = Some(repo_admin_change_team_access); + self + } + + pub fn repo_admin_change_team_access(&self) -> Option<&bool> { + self.repo_admin_change_team_access.as_ref() + } + + pub fn reset_repo_admin_change_team_access(&mut self) { + self.repo_admin_change_team_access = None; + } + + pub fn set_username(&mut self, username: String) { + self.username = Some(username); + } + + pub fn with_username(mut self, username: String) -> Organization { + self.username = Some(username); + self + } + + pub fn username(&self) -> Option<&String> { + self.username.as_ref() + } + + pub fn reset_username(&mut self) { + self.username = None; + } + + pub fn set_visibility(&mut self, visibility: String) { + self.visibility = Some(visibility); + } + + pub fn with_visibility(mut self, visibility: String) -> Organization { + self.visibility = Some(visibility); + self + } + + pub fn visibility(&self) -> Option<&String> { + self.visibility.as_ref() + } + + pub fn reset_visibility(&mut self) { + self.visibility = None; + } + + pub fn set_website(&mut self, website: String) { + self.website = Some(website); + } + + pub fn with_website(mut self, website: String) -> Organization { + self.website = Some(website); + self + } + + pub fn website(&self) -> Option<&String> { + self.website.as_ref() + } + + pub fn reset_website(&mut self) { + self.website = None; + } + +} + + + diff --git a/src/models/payload_commit.rs b/src/models/payload_commit.rs new file mode 100644 index 0000000..1519087 --- /dev/null +++ b/src/models/payload_commit.rs @@ -0,0 +1,231 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// PayloadCommit : PayloadCommit represents a commit + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct PayloadCommit { + #[serde(rename = "added")] + added: Option>, + #[serde(rename = "author")] + author: Option<::models::PayloadUser>, + #[serde(rename = "committer")] + committer: Option<::models::PayloadUser>, + /// sha1 hash of the commit + #[serde(rename = "id")] + id: Option, + #[serde(rename = "message")] + message: Option, + #[serde(rename = "modified")] + modified: Option>, + #[serde(rename = "removed")] + removed: Option>, + #[serde(rename = "timestamp")] + timestamp: Option, + #[serde(rename = "url")] + url: Option, + #[serde(rename = "verification")] + verification: Option<::models::PayloadCommitVerification> +} + +impl PayloadCommit { + /// PayloadCommit represents a commit + pub fn new() -> PayloadCommit { + PayloadCommit { + added: None, + author: None, + committer: None, + id: None, + message: None, + modified: None, + removed: None, + timestamp: None, + url: None, + verification: None + } + } + + pub fn set_added(&mut self, added: Vec) { + self.added = Some(added); + } + + pub fn with_added(mut self, added: Vec) -> PayloadCommit { + self.added = Some(added); + self + } + + pub fn added(&self) -> Option<&Vec> { + self.added.as_ref() + } + + pub fn reset_added(&mut self) { + self.added = None; + } + + pub fn set_author(&mut self, author: ::models::PayloadUser) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: ::models::PayloadUser) -> PayloadCommit { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&::models::PayloadUser> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_committer(&mut self, committer: ::models::PayloadUser) { + self.committer = Some(committer); + } + + pub fn with_committer(mut self, committer: ::models::PayloadUser) -> PayloadCommit { + self.committer = Some(committer); + self + } + + pub fn committer(&self) -> Option<&::models::PayloadUser> { + self.committer.as_ref() + } + + pub fn reset_committer(&mut self) { + self.committer = None; + } + + pub fn set_id(&mut self, id: String) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: String) -> PayloadCommit { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&String> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_message(&mut self, message: String) { + self.message = Some(message); + } + + pub fn with_message(mut self, message: String) -> PayloadCommit { + self.message = Some(message); + self + } + + pub fn message(&self) -> Option<&String> { + self.message.as_ref() + } + + pub fn reset_message(&mut self) { + self.message = None; + } + + pub fn set_modified(&mut self, modified: Vec) { + self.modified = Some(modified); + } + + pub fn with_modified(mut self, modified: Vec) -> PayloadCommit { + self.modified = Some(modified); + self + } + + pub fn modified(&self) -> Option<&Vec> { + self.modified.as_ref() + } + + pub fn reset_modified(&mut self) { + self.modified = None; + } + + pub fn set_removed(&mut self, removed: Vec) { + self.removed = Some(removed); + } + + pub fn with_removed(mut self, removed: Vec) -> PayloadCommit { + self.removed = Some(removed); + self + } + + pub fn removed(&self) -> Option<&Vec> { + self.removed.as_ref() + } + + pub fn reset_removed(&mut self) { + self.removed = None; + } + + pub fn set_timestamp(&mut self, timestamp: String) { + self.timestamp = Some(timestamp); + } + + pub fn with_timestamp(mut self, timestamp: String) -> PayloadCommit { + self.timestamp = Some(timestamp); + self + } + + pub fn timestamp(&self) -> Option<&String> { + self.timestamp.as_ref() + } + + pub fn reset_timestamp(&mut self) { + self.timestamp = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> PayloadCommit { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + + pub fn set_verification(&mut self, verification: ::models::PayloadCommitVerification) { + self.verification = Some(verification); + } + + pub fn with_verification(mut self, verification: ::models::PayloadCommitVerification) -> PayloadCommit { + self.verification = Some(verification); + self + } + + pub fn verification(&self) -> Option<&::models::PayloadCommitVerification> { + self.verification.as_ref() + } + + pub fn reset_verification(&mut self) { + self.verification = None; + } + +} + + + diff --git a/src/models/payload_commit_verification.rs b/src/models/payload_commit_verification.rs new file mode 100644 index 0000000..2302786 --- /dev/null +++ b/src/models/payload_commit_verification.rs @@ -0,0 +1,130 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// PayloadCommitVerification : PayloadCommitVerification represents the GPG verification of a commit + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct PayloadCommitVerification { + #[serde(rename = "payload")] + payload: Option, + #[serde(rename = "reason")] + reason: Option, + #[serde(rename = "signature")] + signature: Option, + #[serde(rename = "signer")] + signer: Option<::models::PayloadUser>, + #[serde(rename = "verified")] + verified: Option +} + +impl PayloadCommitVerification { + /// PayloadCommitVerification represents the GPG verification of a commit + pub fn new() -> PayloadCommitVerification { + PayloadCommitVerification { + payload: None, + reason: None, + signature: None, + signer: None, + verified: None + } + } + + pub fn set_payload(&mut self, payload: String) { + self.payload = Some(payload); + } + + pub fn with_payload(mut self, payload: String) -> PayloadCommitVerification { + self.payload = Some(payload); + self + } + + pub fn payload(&self) -> Option<&String> { + self.payload.as_ref() + } + + pub fn reset_payload(&mut self) { + self.payload = None; + } + + pub fn set_reason(&mut self, reason: String) { + self.reason = Some(reason); + } + + pub fn with_reason(mut self, reason: String) -> PayloadCommitVerification { + self.reason = Some(reason); + self + } + + pub fn reason(&self) -> Option<&String> { + self.reason.as_ref() + } + + pub fn reset_reason(&mut self) { + self.reason = None; + } + + pub fn set_signature(&mut self, signature: String) { + self.signature = Some(signature); + } + + pub fn with_signature(mut self, signature: String) -> PayloadCommitVerification { + self.signature = Some(signature); + self + } + + pub fn signature(&self) -> Option<&String> { + self.signature.as_ref() + } + + pub fn reset_signature(&mut self) { + self.signature = None; + } + + pub fn set_signer(&mut self, signer: ::models::PayloadUser) { + self.signer = Some(signer); + } + + pub fn with_signer(mut self, signer: ::models::PayloadUser) -> PayloadCommitVerification { + self.signer = Some(signer); + self + } + + pub fn signer(&self) -> Option<&::models::PayloadUser> { + self.signer.as_ref() + } + + pub fn reset_signer(&mut self) { + self.signer = None; + } + + pub fn set_verified(&mut self, verified: bool) { + self.verified = Some(verified); + } + + pub fn with_verified(mut self, verified: bool) -> PayloadCommitVerification { + self.verified = Some(verified); + self + } + + pub fn verified(&self) -> Option<&bool> { + self.verified.as_ref() + } + + pub fn reset_verified(&mut self) { + self.verified = None; + } + +} + + + diff --git a/src/models/payload_user.rs b/src/models/payload_user.rs new file mode 100644 index 0000000..17a9080 --- /dev/null +++ b/src/models/payload_user.rs @@ -0,0 +1,91 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// PayloadUser : PayloadUser represents the author or committer of a commit + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct PayloadUser { + #[serde(rename = "email")] + email: Option, + /// Full name of the commit author + #[serde(rename = "name")] + name: Option, + #[serde(rename = "username")] + username: Option +} + +impl PayloadUser { + /// PayloadUser represents the author or committer of a commit + pub fn new() -> PayloadUser { + PayloadUser { + email: None, + name: None, + username: None + } + } + + pub fn set_email(&mut self, email: String) { + self.email = Some(email); + } + + pub fn with_email(mut self, email: String) -> PayloadUser { + self.email = Some(email); + self + } + + pub fn email(&self) -> Option<&String> { + self.email.as_ref() + } + + pub fn reset_email(&mut self) { + self.email = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> PayloadUser { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_username(&mut self, username: String) { + self.username = Some(username); + } + + pub fn with_username(mut self, username: String) -> PayloadUser { + self.username = Some(username); + self + } + + pub fn username(&self) -> Option<&String> { + self.username.as_ref() + } + + pub fn reset_username(&mut self) { + self.username = None; + } + +} + + + diff --git a/src/models/permission.rs b/src/models/permission.rs new file mode 100644 index 0000000..9a3d0c9 --- /dev/null +++ b/src/models/permission.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Permission : Permission represents a set of permissions + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Permission { + #[serde(rename = "admin")] + admin: Option, + #[serde(rename = "pull")] + pull: Option, + #[serde(rename = "push")] + push: Option +} + +impl Permission { + /// Permission represents a set of permissions + pub fn new() -> Permission { + Permission { + admin: None, + pull: None, + push: None + } + } + + pub fn set_admin(&mut self, admin: bool) { + self.admin = Some(admin); + } + + pub fn with_admin(mut self, admin: bool) -> Permission { + self.admin = Some(admin); + self + } + + pub fn admin(&self) -> Option<&bool> { + self.admin.as_ref() + } + + pub fn reset_admin(&mut self) { + self.admin = None; + } + + pub fn set_pull(&mut self, pull: bool) { + self.pull = Some(pull); + } + + pub fn with_pull(mut self, pull: bool) -> Permission { + self.pull = Some(pull); + self + } + + pub fn pull(&self) -> Option<&bool> { + self.pull.as_ref() + } + + pub fn reset_pull(&mut self) { + self.pull = None; + } + + pub fn set_push(&mut self, push: bool) { + self.push = Some(push); + } + + pub fn with_push(mut self, push: bool) -> Permission { + self.push = Some(push); + self + } + + pub fn push(&self) -> Option<&bool> { + self.push.as_ref() + } + + pub fn reset_push(&mut self) { + self.push = None; + } + +} + + + diff --git a/src/models/pr_branch_info.rs b/src/models/pr_branch_info.rs new file mode 100644 index 0000000..21dbf88 --- /dev/null +++ b/src/models/pr_branch_info.rs @@ -0,0 +1,130 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// PrBranchInfo : PRBranchInfo information about a branch + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct PrBranchInfo { + #[serde(rename = "label")] + label: Option, + #[serde(rename = "ref")] + _ref: Option, + #[serde(rename = "repo")] + repo: Option<::models::Repository>, + #[serde(rename = "repo_id")] + repo_id: Option, + #[serde(rename = "sha")] + sha: Option +} + +impl PrBranchInfo { + /// PRBranchInfo information about a branch + pub fn new() -> PrBranchInfo { + PrBranchInfo { + label: None, + _ref: None, + repo: None, + repo_id: None, + sha: None + } + } + + pub fn set_label(&mut self, label: String) { + self.label = Some(label); + } + + pub fn with_label(mut self, label: String) -> PrBranchInfo { + self.label = Some(label); + self + } + + pub fn label(&self) -> Option<&String> { + self.label.as_ref() + } + + pub fn reset_label(&mut self) { + self.label = None; + } + + pub fn set__ref(&mut self, _ref: String) { + self._ref = Some(_ref); + } + + pub fn with__ref(mut self, _ref: String) -> PrBranchInfo { + self._ref = Some(_ref); + self + } + + pub fn _ref(&self) -> Option<&String> { + self._ref.as_ref() + } + + pub fn reset__ref(&mut self) { + self._ref = None; + } + + pub fn set_repo(&mut self, repo: ::models::Repository) { + self.repo = Some(repo); + } + + pub fn with_repo(mut self, repo: ::models::Repository) -> PrBranchInfo { + self.repo = Some(repo); + self + } + + pub fn repo(&self) -> Option<&::models::Repository> { + self.repo.as_ref() + } + + pub fn reset_repo(&mut self) { + self.repo = None; + } + + pub fn set_repo_id(&mut self, repo_id: i64) { + self.repo_id = Some(repo_id); + } + + pub fn with_repo_id(mut self, repo_id: i64) -> PrBranchInfo { + self.repo_id = Some(repo_id); + self + } + + pub fn repo_id(&self) -> Option<&i64> { + self.repo_id.as_ref() + } + + pub fn reset_repo_id(&mut self) { + self.repo_id = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = Some(sha); + } + + pub fn with_sha(mut self, sha: String) -> PrBranchInfo { + self.sha = Some(sha); + self + } + + pub fn sha(&self) -> Option<&String> { + self.sha.as_ref() + } + + pub fn reset_sha(&mut self) { + self.sha = None; + } + +} + + + diff --git a/src/models/public_key.rs b/src/models/public_key.rs new file mode 100644 index 0000000..4b0852e --- /dev/null +++ b/src/models/public_key.rs @@ -0,0 +1,210 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// PublicKey : PublicKey publickey is a user key to push code to repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct PublicKey { + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "fingerprint")] + fingerprint: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "key")] + key: Option, + #[serde(rename = "key_type")] + key_type: Option, + #[serde(rename = "read_only")] + read_only: Option, + #[serde(rename = "title")] + title: Option, + #[serde(rename = "url")] + url: Option, + #[serde(rename = "user")] + user: Option<::models::User> +} + +impl PublicKey { + /// PublicKey publickey is a user key to push code to repository + pub fn new() -> PublicKey { + PublicKey { + created_at: None, + fingerprint: None, + id: None, + key: None, + key_type: None, + read_only: None, + title: None, + url: None, + user: None + } + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> PublicKey { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_fingerprint(&mut self, fingerprint: String) { + self.fingerprint = Some(fingerprint); + } + + pub fn with_fingerprint(mut self, fingerprint: String) -> PublicKey { + self.fingerprint = Some(fingerprint); + self + } + + pub fn fingerprint(&self) -> Option<&String> { + self.fingerprint.as_ref() + } + + pub fn reset_fingerprint(&mut self) { + self.fingerprint = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> PublicKey { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_key(&mut self, key: String) { + self.key = Some(key); + } + + pub fn with_key(mut self, key: String) -> PublicKey { + self.key = Some(key); + self + } + + pub fn key(&self) -> Option<&String> { + self.key.as_ref() + } + + pub fn reset_key(&mut self) { + self.key = None; + } + + pub fn set_key_type(&mut self, key_type: String) { + self.key_type = Some(key_type); + } + + pub fn with_key_type(mut self, key_type: String) -> PublicKey { + self.key_type = Some(key_type); + self + } + + pub fn key_type(&self) -> Option<&String> { + self.key_type.as_ref() + } + + pub fn reset_key_type(&mut self) { + self.key_type = None; + } + + pub fn set_read_only(&mut self, read_only: bool) { + self.read_only = Some(read_only); + } + + pub fn with_read_only(mut self, read_only: bool) -> PublicKey { + self.read_only = Some(read_only); + self + } + + pub fn read_only(&self) -> Option<&bool> { + self.read_only.as_ref() + } + + pub fn reset_read_only(&mut self) { + self.read_only = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> PublicKey { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> PublicKey { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + + pub fn set_user(&mut self, user: ::models::User) { + self.user = Some(user); + } + + pub fn with_user(mut self, user: ::models::User) -> PublicKey { + self.user = Some(user); + self + } + + pub fn user(&self) -> Option<&::models::User> { + self.user.as_ref() + } + + pub fn reset_user(&mut self) { + self.user = None; + } + +} + + + diff --git a/src/models/pull_request.rs b/src/models/pull_request.rs new file mode 100644 index 0000000..8028a00 --- /dev/null +++ b/src/models/pull_request.rs @@ -0,0 +1,570 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// PullRequest : PullRequest represents a pull request + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct PullRequest { + #[serde(rename = "assignee")] + assignee: Option<::models::User>, + #[serde(rename = "assignees")] + assignees: Option>, + #[serde(rename = "base")] + base: Option<::models::PrBranchInfo>, + #[serde(rename = "body")] + body: Option, + #[serde(rename = "closed_at")] + closed_at: Option, + #[serde(rename = "comments")] + comments: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "diff_url")] + diff_url: Option, + #[serde(rename = "due_date")] + due_date: Option, + #[serde(rename = "head")] + head: Option<::models::PrBranchInfo>, + #[serde(rename = "html_url")] + html_url: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "labels")] + labels: Option>, + #[serde(rename = "merge_base")] + merge_base: Option, + #[serde(rename = "merge_commit_sha")] + merge_commit_sha: Option, + #[serde(rename = "mergeable")] + mergeable: Option, + #[serde(rename = "merged")] + merged: Option, + #[serde(rename = "merged_at")] + merged_at: Option, + #[serde(rename = "merged_by")] + merged_by: Option<::models::User>, + #[serde(rename = "milestone")] + milestone: Option<::models::Milestone>, + #[serde(rename = "number")] + number: Option, + #[serde(rename = "patch_url")] + patch_url: Option, + #[serde(rename = "state")] + state: Option<::models::StateType>, + #[serde(rename = "title")] + title: Option, + #[serde(rename = "updated_at")] + updated_at: Option, + #[serde(rename = "url")] + url: Option, + #[serde(rename = "user")] + user: Option<::models::User> +} + +impl PullRequest { + /// PullRequest represents a pull request + pub fn new() -> PullRequest { + PullRequest { + assignee: None, + assignees: None, + base: None, + body: None, + closed_at: None, + comments: None, + created_at: None, + diff_url: None, + due_date: None, + head: None, + html_url: None, + id: None, + labels: None, + merge_base: None, + merge_commit_sha: None, + mergeable: None, + merged: None, + merged_at: None, + merged_by: None, + milestone: None, + number: None, + patch_url: None, + state: None, + title: None, + updated_at: None, + url: None, + user: None + } + } + + pub fn set_assignee(&mut self, assignee: ::models::User) { + self.assignee = Some(assignee); + } + + pub fn with_assignee(mut self, assignee: ::models::User) -> PullRequest { + self.assignee = Some(assignee); + self + } + + pub fn assignee(&self) -> Option<&::models::User> { + self.assignee.as_ref() + } + + pub fn reset_assignee(&mut self) { + self.assignee = None; + } + + pub fn set_assignees(&mut self, assignees: Vec<::models::User>) { + self.assignees = Some(assignees); + } + + pub fn with_assignees(mut self, assignees: Vec<::models::User>) -> PullRequest { + self.assignees = Some(assignees); + self + } + + pub fn assignees(&self) -> Option<&Vec<::models::User>> { + self.assignees.as_ref() + } + + pub fn reset_assignees(&mut self) { + self.assignees = None; + } + + pub fn set_base(&mut self, base: ::models::PrBranchInfo) { + self.base = Some(base); + } + + pub fn with_base(mut self, base: ::models::PrBranchInfo) -> PullRequest { + self.base = Some(base); + self + } + + pub fn base(&self) -> Option<&::models::PrBranchInfo> { + self.base.as_ref() + } + + pub fn reset_base(&mut self) { + self.base = None; + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> PullRequest { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_closed_at(&mut self, closed_at: String) { + self.closed_at = Some(closed_at); + } + + pub fn with_closed_at(mut self, closed_at: String) -> PullRequest { + self.closed_at = Some(closed_at); + self + } + + pub fn closed_at(&self) -> Option<&String> { + self.closed_at.as_ref() + } + + pub fn reset_closed_at(&mut self) { + self.closed_at = None; + } + + pub fn set_comments(&mut self, comments: i64) { + self.comments = Some(comments); + } + + pub fn with_comments(mut self, comments: i64) -> PullRequest { + self.comments = Some(comments); + self + } + + pub fn comments(&self) -> Option<&i64> { + self.comments.as_ref() + } + + pub fn reset_comments(&mut self) { + self.comments = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> PullRequest { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_diff_url(&mut self, diff_url: String) { + self.diff_url = Some(diff_url); + } + + pub fn with_diff_url(mut self, diff_url: String) -> PullRequest { + self.diff_url = Some(diff_url); + self + } + + pub fn diff_url(&self) -> Option<&String> { + self.diff_url.as_ref() + } + + pub fn reset_diff_url(&mut self) { + self.diff_url = None; + } + + pub fn set_due_date(&mut self, due_date: String) { + self.due_date = Some(due_date); + } + + pub fn with_due_date(mut self, due_date: String) -> PullRequest { + self.due_date = Some(due_date); + self + } + + pub fn due_date(&self) -> Option<&String> { + self.due_date.as_ref() + } + + pub fn reset_due_date(&mut self) { + self.due_date = None; + } + + pub fn set_head(&mut self, head: ::models::PrBranchInfo) { + self.head = Some(head); + } + + pub fn with_head(mut self, head: ::models::PrBranchInfo) -> PullRequest { + self.head = Some(head); + self + } + + pub fn head(&self) -> Option<&::models::PrBranchInfo> { + self.head.as_ref() + } + + pub fn reset_head(&mut self) { + self.head = None; + } + + pub fn set_html_url(&mut self, html_url: String) { + self.html_url = Some(html_url); + } + + pub fn with_html_url(mut self, html_url: String) -> PullRequest { + self.html_url = Some(html_url); + self + } + + pub fn html_url(&self) -> Option<&String> { + self.html_url.as_ref() + } + + pub fn reset_html_url(&mut self) { + self.html_url = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> PullRequest { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_labels(&mut self, labels: Vec<::models::Label>) { + self.labels = Some(labels); + } + + pub fn with_labels(mut self, labels: Vec<::models::Label>) -> PullRequest { + self.labels = Some(labels); + self + } + + pub fn labels(&self) -> Option<&Vec<::models::Label>> { + self.labels.as_ref() + } + + pub fn reset_labels(&mut self) { + self.labels = None; + } + + pub fn set_merge_base(&mut self, merge_base: String) { + self.merge_base = Some(merge_base); + } + + pub fn with_merge_base(mut self, merge_base: String) -> PullRequest { + self.merge_base = Some(merge_base); + self + } + + pub fn merge_base(&self) -> Option<&String> { + self.merge_base.as_ref() + } + + pub fn reset_merge_base(&mut self) { + self.merge_base = None; + } + + pub fn set_merge_commit_sha(&mut self, merge_commit_sha: String) { + self.merge_commit_sha = Some(merge_commit_sha); + } + + pub fn with_merge_commit_sha(mut self, merge_commit_sha: String) -> PullRequest { + self.merge_commit_sha = Some(merge_commit_sha); + self + } + + pub fn merge_commit_sha(&self) -> Option<&String> { + self.merge_commit_sha.as_ref() + } + + pub fn reset_merge_commit_sha(&mut self) { + self.merge_commit_sha = None; + } + + pub fn set_mergeable(&mut self, mergeable: bool) { + self.mergeable = Some(mergeable); + } + + pub fn with_mergeable(mut self, mergeable: bool) -> PullRequest { + self.mergeable = Some(mergeable); + self + } + + pub fn mergeable(&self) -> Option<&bool> { + self.mergeable.as_ref() + } + + pub fn reset_mergeable(&mut self) { + self.mergeable = None; + } + + pub fn set_merged(&mut self, merged: bool) { + self.merged = Some(merged); + } + + pub fn with_merged(mut self, merged: bool) -> PullRequest { + self.merged = Some(merged); + self + } + + pub fn merged(&self) -> Option<&bool> { + self.merged.as_ref() + } + + pub fn reset_merged(&mut self) { + self.merged = None; + } + + pub fn set_merged_at(&mut self, merged_at: String) { + self.merged_at = Some(merged_at); + } + + pub fn with_merged_at(mut self, merged_at: String) -> PullRequest { + self.merged_at = Some(merged_at); + self + } + + pub fn merged_at(&self) -> Option<&String> { + self.merged_at.as_ref() + } + + pub fn reset_merged_at(&mut self) { + self.merged_at = None; + } + + pub fn set_merged_by(&mut self, merged_by: ::models::User) { + self.merged_by = Some(merged_by); + } + + pub fn with_merged_by(mut self, merged_by: ::models::User) -> PullRequest { + self.merged_by = Some(merged_by); + self + } + + pub fn merged_by(&self) -> Option<&::models::User> { + self.merged_by.as_ref() + } + + pub fn reset_merged_by(&mut self) { + self.merged_by = None; + } + + pub fn set_milestone(&mut self, milestone: ::models::Milestone) { + self.milestone = Some(milestone); + } + + pub fn with_milestone(mut self, milestone: ::models::Milestone) -> PullRequest { + self.milestone = Some(milestone); + self + } + + pub fn milestone(&self) -> Option<&::models::Milestone> { + self.milestone.as_ref() + } + + pub fn reset_milestone(&mut self) { + self.milestone = None; + } + + pub fn set_number(&mut self, number: i64) { + self.number = Some(number); + } + + pub fn with_number(mut self, number: i64) -> PullRequest { + self.number = Some(number); + self + } + + pub fn number(&self) -> Option<&i64> { + self.number.as_ref() + } + + pub fn reset_number(&mut self) { + self.number = None; + } + + pub fn set_patch_url(&mut self, patch_url: String) { + self.patch_url = Some(patch_url); + } + + pub fn with_patch_url(mut self, patch_url: String) -> PullRequest { + self.patch_url = Some(patch_url); + self + } + + pub fn patch_url(&self) -> Option<&String> { + self.patch_url.as_ref() + } + + pub fn reset_patch_url(&mut self) { + self.patch_url = None; + } + + pub fn set_state(&mut self, state: ::models::StateType) { + self.state = Some(state); + } + + pub fn with_state(mut self, state: ::models::StateType) -> PullRequest { + self.state = Some(state); + self + } + + pub fn state(&self) -> Option<&::models::StateType> { + self.state.as_ref() + } + + pub fn reset_state(&mut self) { + self.state = None; + } + + pub fn set_title(&mut self, title: String) { + self.title = Some(title); + } + + pub fn with_title(mut self, title: String) -> PullRequest { + self.title = Some(title); + self + } + + pub fn title(&self) -> Option<&String> { + self.title.as_ref() + } + + pub fn reset_title(&mut self) { + self.title = None; + } + + pub fn set_updated_at(&mut self, updated_at: String) { + self.updated_at = Some(updated_at); + } + + pub fn with_updated_at(mut self, updated_at: String) -> PullRequest { + self.updated_at = Some(updated_at); + self + } + + pub fn updated_at(&self) -> Option<&String> { + self.updated_at.as_ref() + } + + pub fn reset_updated_at(&mut self) { + self.updated_at = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> PullRequest { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + + pub fn set_user(&mut self, user: ::models::User) { + self.user = Some(user); + } + + pub fn with_user(mut self, user: ::models::User) -> PullRequest { + self.user = Some(user); + self + } + + pub fn user(&self) -> Option<&::models::User> { + self.user.as_ref() + } + + pub fn reset_user(&mut self) { + self.user = None; + } + +} + + + diff --git a/src/models/pull_request_meta.rs b/src/models/pull_request_meta.rs new file mode 100644 index 0000000..8ed42af --- /dev/null +++ b/src/models/pull_request_meta.rs @@ -0,0 +1,70 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// PullRequestMeta : PullRequestMeta PR info if an issue is a PR + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct PullRequestMeta { + #[serde(rename = "merged")] + merged: Option, + #[serde(rename = "merged_at")] + merged_at: Option +} + +impl PullRequestMeta { + /// PullRequestMeta PR info if an issue is a PR + pub fn new() -> PullRequestMeta { + PullRequestMeta { + merged: None, + merged_at: None + } + } + + pub fn set_merged(&mut self, merged: bool) { + self.merged = Some(merged); + } + + pub fn with_merged(mut self, merged: bool) -> PullRequestMeta { + self.merged = Some(merged); + self + } + + pub fn merged(&self) -> Option<&bool> { + self.merged.as_ref() + } + + pub fn reset_merged(&mut self) { + self.merged = None; + } + + pub fn set_merged_at(&mut self, merged_at: String) { + self.merged_at = Some(merged_at); + } + + pub fn with_merged_at(mut self, merged_at: String) -> PullRequestMeta { + self.merged_at = Some(merged_at); + self + } + + pub fn merged_at(&self) -> Option<&String> { + self.merged_at.as_ref() + } + + pub fn reset_merged_at(&mut self) { + self.merged_at = None; + } + +} + + + diff --git a/src/models/reaction.rs b/src/models/reaction.rs new file mode 100644 index 0000000..590c21e --- /dev/null +++ b/src/models/reaction.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Reaction : Reaction contain one reaction + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Reaction { + #[serde(rename = "content")] + content: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "user")] + user: Option<::models::User> +} + +impl Reaction { + /// Reaction contain one reaction + pub fn new() -> Reaction { + Reaction { + content: None, + created_at: None, + user: None + } + } + + pub fn set_content(&mut self, content: String) { + self.content = Some(content); + } + + pub fn with_content(mut self, content: String) -> Reaction { + self.content = Some(content); + self + } + + pub fn content(&self) -> Option<&String> { + self.content.as_ref() + } + + pub fn reset_content(&mut self) { + self.content = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> Reaction { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_user(&mut self, user: ::models::User) { + self.user = Some(user); + } + + pub fn with_user(mut self, user: ::models::User) -> Reaction { + self.user = Some(user); + self + } + + pub fn user(&self) -> Option<&::models::User> { + self.user.as_ref() + } + + pub fn reset_user(&mut self) { + self.user = None; + } + +} + + + diff --git a/src/models/reference.rs b/src/models/reference.rs new file mode 100644 index 0000000..5c799c3 --- /dev/null +++ b/src/models/reference.rs @@ -0,0 +1,88 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Reference { + #[serde(rename = "object")] + object: Option<::models::GitObject>, + #[serde(rename = "ref")] + _ref: Option, + #[serde(rename = "url")] + url: Option +} + +impl Reference { + pub fn new() -> Reference { + Reference { + object: None, + _ref: None, + url: None + } + } + + pub fn set_object(&mut self, object: ::models::GitObject) { + self.object = Some(object); + } + + pub fn with_object(mut self, object: ::models::GitObject) -> Reference { + self.object = Some(object); + self + } + + pub fn object(&self) -> Option<&::models::GitObject> { + self.object.as_ref() + } + + pub fn reset_object(&mut self) { + self.object = None; + } + + pub fn set__ref(&mut self, _ref: String) { + self._ref = Some(_ref); + } + + pub fn with__ref(mut self, _ref: String) -> Reference { + self._ref = Some(_ref); + self + } + + pub fn _ref(&self) -> Option<&String> { + self._ref.as_ref() + } + + pub fn reset__ref(&mut self) { + self._ref = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> Reference { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/release.rs b/src/models/release.rs new file mode 100644 index 0000000..567b636 --- /dev/null +++ b/src/models/release.rs @@ -0,0 +1,310 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Release : Release represents a repository release + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Release { + #[serde(rename = "assets")] + assets: Option>, + #[serde(rename = "author")] + author: Option<::models::User>, + #[serde(rename = "body")] + body: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "draft")] + draft: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "prerelease")] + prerelease: Option, + #[serde(rename = "published_at")] + published_at: Option, + #[serde(rename = "tag_name")] + tag_name: Option, + #[serde(rename = "tarball_url")] + tarball_url: Option, + #[serde(rename = "target_commitish")] + target_commitish: Option, + #[serde(rename = "url")] + url: Option, + #[serde(rename = "zipball_url")] + zipball_url: Option +} + +impl Release { + /// Release represents a repository release + pub fn new() -> Release { + Release { + assets: None, + author: None, + body: None, + created_at: None, + draft: None, + id: None, + name: None, + prerelease: None, + published_at: None, + tag_name: None, + tarball_url: None, + target_commitish: None, + url: None, + zipball_url: None + } + } + + pub fn set_assets(&mut self, assets: Vec<::models::Attachment>) { + self.assets = Some(assets); + } + + pub fn with_assets(mut self, assets: Vec<::models::Attachment>) -> Release { + self.assets = Some(assets); + self + } + + pub fn assets(&self) -> Option<&Vec<::models::Attachment>> { + self.assets.as_ref() + } + + pub fn reset_assets(&mut self) { + self.assets = None; + } + + pub fn set_author(&mut self, author: ::models::User) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: ::models::User) -> Release { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&::models::User> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_body(&mut self, body: String) { + self.body = Some(body); + } + + pub fn with_body(mut self, body: String) -> Release { + self.body = Some(body); + self + } + + pub fn body(&self) -> Option<&String> { + self.body.as_ref() + } + + pub fn reset_body(&mut self) { + self.body = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> Release { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_draft(&mut self, draft: bool) { + self.draft = Some(draft); + } + + pub fn with_draft(mut self, draft: bool) -> Release { + self.draft = Some(draft); + self + } + + pub fn draft(&self) -> Option<&bool> { + self.draft.as_ref() + } + + pub fn reset_draft(&mut self) { + self.draft = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Release { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> Release { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_prerelease(&mut self, prerelease: bool) { + self.prerelease = Some(prerelease); + } + + pub fn with_prerelease(mut self, prerelease: bool) -> Release { + self.prerelease = Some(prerelease); + self + } + + pub fn prerelease(&self) -> Option<&bool> { + self.prerelease.as_ref() + } + + pub fn reset_prerelease(&mut self) { + self.prerelease = None; + } + + pub fn set_published_at(&mut self, published_at: String) { + self.published_at = Some(published_at); + } + + pub fn with_published_at(mut self, published_at: String) -> Release { + self.published_at = Some(published_at); + self + } + + pub fn published_at(&self) -> Option<&String> { + self.published_at.as_ref() + } + + pub fn reset_published_at(&mut self) { + self.published_at = None; + } + + pub fn set_tag_name(&mut self, tag_name: String) { + self.tag_name = Some(tag_name); + } + + pub fn with_tag_name(mut self, tag_name: String) -> Release { + self.tag_name = Some(tag_name); + self + } + + pub fn tag_name(&self) -> Option<&String> { + self.tag_name.as_ref() + } + + pub fn reset_tag_name(&mut self) { + self.tag_name = None; + } + + pub fn set_tarball_url(&mut self, tarball_url: String) { + self.tarball_url = Some(tarball_url); + } + + pub fn with_tarball_url(mut self, tarball_url: String) -> Release { + self.tarball_url = Some(tarball_url); + self + } + + pub fn tarball_url(&self) -> Option<&String> { + self.tarball_url.as_ref() + } + + pub fn reset_tarball_url(&mut self) { + self.tarball_url = None; + } + + pub fn set_target_commitish(&mut self, target_commitish: String) { + self.target_commitish = Some(target_commitish); + } + + pub fn with_target_commitish(mut self, target_commitish: String) -> Release { + self.target_commitish = Some(target_commitish); + self + } + + pub fn target_commitish(&self) -> Option<&String> { + self.target_commitish.as_ref() + } + + pub fn reset_target_commitish(&mut self) { + self.target_commitish = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> Release { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + + pub fn set_zipball_url(&mut self, zipball_url: String) { + self.zipball_url = Some(zipball_url); + } + + pub fn with_zipball_url(mut self, zipball_url: String) -> Release { + self.zipball_url = Some(zipball_url); + self + } + + pub fn zipball_url(&self) -> Option<&String> { + self.zipball_url.as_ref() + } + + pub fn reset_zipball_url(&mut self) { + self.zipball_url = None; + } + +} + + + diff --git a/src/models/repo_commit.rs b/src/models/repo_commit.rs new file mode 100644 index 0000000..feaa459 --- /dev/null +++ b/src/models/repo_commit.rs @@ -0,0 +1,128 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct RepoCommit { + #[serde(rename = "author")] + author: Option<::models::CommitUser>, + #[serde(rename = "committer")] + committer: Option<::models::CommitUser>, + #[serde(rename = "message")] + message: Option, + #[serde(rename = "tree")] + tree: Option<::models::CommitMeta>, + #[serde(rename = "url")] + url: Option +} + +impl RepoCommit { + pub fn new() -> RepoCommit { + RepoCommit { + author: None, + committer: None, + message: None, + tree: None, + url: None + } + } + + pub fn set_author(&mut self, author: ::models::CommitUser) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: ::models::CommitUser) -> RepoCommit { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&::models::CommitUser> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_committer(&mut self, committer: ::models::CommitUser) { + self.committer = Some(committer); + } + + pub fn with_committer(mut self, committer: ::models::CommitUser) -> RepoCommit { + self.committer = Some(committer); + self + } + + pub fn committer(&self) -> Option<&::models::CommitUser> { + self.committer.as_ref() + } + + pub fn reset_committer(&mut self) { + self.committer = None; + } + + pub fn set_message(&mut self, message: String) { + self.message = Some(message); + } + + pub fn with_message(mut self, message: String) -> RepoCommit { + self.message = Some(message); + self + } + + pub fn message(&self) -> Option<&String> { + self.message.as_ref() + } + + pub fn reset_message(&mut self) { + self.message = None; + } + + pub fn set_tree(&mut self, tree: ::models::CommitMeta) { + self.tree = Some(tree); + } + + pub fn with_tree(mut self, tree: ::models::CommitMeta) -> RepoCommit { + self.tree = Some(tree); + self + } + + pub fn tree(&self) -> Option<&::models::CommitMeta> { + self.tree.as_ref() + } + + pub fn reset_tree(&mut self) { + self.tree = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> RepoCommit { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/repo_topic_options.rs b/src/models/repo_topic_options.rs new file mode 100644 index 0000000..01c6abd --- /dev/null +++ b/src/models/repo_topic_options.rs @@ -0,0 +1,51 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// RepoTopicOptions : RepoTopicOptions a collection of repo topic names + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct RepoTopicOptions { + /// list of topic names + #[serde(rename = "topics")] + topics: Option> +} + +impl RepoTopicOptions { + /// RepoTopicOptions a collection of repo topic names + pub fn new() -> RepoTopicOptions { + RepoTopicOptions { + topics: None + } + } + + pub fn set_topics(&mut self, topics: Vec) { + self.topics = Some(topics); + } + + pub fn with_topics(mut self, topics: Vec) -> RepoTopicOptions { + self.topics = Some(topics); + self + } + + pub fn topics(&self) -> Option<&Vec> { + self.topics.as_ref() + } + + pub fn reset_topics(&mut self) { + self.topics = None; + } + +} + + + diff --git a/src/models/repository.rs b/src/models/repository.rs new file mode 100644 index 0000000..8be02ae --- /dev/null +++ b/src/models/repository.rs @@ -0,0 +1,830 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Repository : Repository represents a repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Repository { + #[serde(rename = "allow_merge_commits")] + allow_merge_commits: Option, + #[serde(rename = "allow_rebase")] + allow_rebase: Option, + #[serde(rename = "allow_rebase_explicit")] + allow_rebase_explicit: Option, + #[serde(rename = "allow_squash_merge")] + allow_squash_merge: Option, + #[serde(rename = "archived")] + archived: Option, + #[serde(rename = "avatar_url")] + avatar_url: Option, + #[serde(rename = "clone_url")] + clone_url: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "default_branch")] + default_branch: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "empty")] + empty: Option, + #[serde(rename = "external_tracker")] + external_tracker: Option<::models::ExternalTracker>, + #[serde(rename = "external_wiki")] + external_wiki: Option<::models::ExternalWiki>, + #[serde(rename = "fork")] + fork: Option, + #[serde(rename = "forks_count")] + forks_count: Option, + #[serde(rename = "full_name")] + full_name: Option, + #[serde(rename = "has_issues")] + has_issues: Option, + #[serde(rename = "has_pull_requests")] + has_pull_requests: Option, + #[serde(rename = "has_wiki")] + has_wiki: Option, + #[serde(rename = "html_url")] + html_url: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "ignore_whitespace_conflicts")] + ignore_whitespace_conflicts: Option, + #[serde(rename = "internal_tracker")] + internal_tracker: Option<::models::InternalTracker>, + #[serde(rename = "mirror")] + mirror: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "open_issues_count")] + open_issues_count: Option, + #[serde(rename = "open_pr_counter")] + open_pr_counter: Option, + #[serde(rename = "original_url")] + original_url: Option, + #[serde(rename = "owner")] + owner: Option<::models::User>, + #[serde(rename = "parent")] + parent: Option<::models::Repository>, + #[serde(rename = "permissions")] + permissions: Option<::models::Permission>, + #[serde(rename = "private")] + private: Option, + #[serde(rename = "release_counter")] + release_counter: Option, + #[serde(rename = "size")] + size: Option, + #[serde(rename = "ssh_url")] + ssh_url: Option, + #[serde(rename = "stars_count")] + stars_count: Option, + #[serde(rename = "template")] + template: Option, + #[serde(rename = "updated_at")] + updated_at: Option, + #[serde(rename = "watchers_count")] + watchers_count: Option, + #[serde(rename = "website")] + website: Option +} + +impl Repository { + /// Repository represents a repository + pub fn new() -> Repository { + Repository { + allow_merge_commits: None, + allow_rebase: None, + allow_rebase_explicit: None, + allow_squash_merge: None, + archived: None, + avatar_url: None, + clone_url: None, + created_at: None, + default_branch: None, + description: None, + empty: None, + external_tracker: None, + external_wiki: None, + fork: None, + forks_count: None, + full_name: None, + has_issues: None, + has_pull_requests: None, + has_wiki: None, + html_url: None, + id: None, + ignore_whitespace_conflicts: None, + internal_tracker: None, + mirror: None, + name: None, + open_issues_count: None, + open_pr_counter: None, + original_url: None, + owner: None, + parent: None, + permissions: None, + private: None, + release_counter: None, + size: None, + ssh_url: None, + stars_count: None, + template: None, + updated_at: None, + watchers_count: None, + website: None + } + } + + pub fn set_allow_merge_commits(&mut self, allow_merge_commits: bool) { + self.allow_merge_commits = Some(allow_merge_commits); + } + + pub fn with_allow_merge_commits(mut self, allow_merge_commits: bool) -> Repository { + self.allow_merge_commits = Some(allow_merge_commits); + self + } + + pub fn allow_merge_commits(&self) -> Option<&bool> { + self.allow_merge_commits.as_ref() + } + + pub fn reset_allow_merge_commits(&mut self) { + self.allow_merge_commits = None; + } + + pub fn set_allow_rebase(&mut self, allow_rebase: bool) { + self.allow_rebase = Some(allow_rebase); + } + + pub fn with_allow_rebase(mut self, allow_rebase: bool) -> Repository { + self.allow_rebase = Some(allow_rebase); + self + } + + pub fn allow_rebase(&self) -> Option<&bool> { + self.allow_rebase.as_ref() + } + + pub fn reset_allow_rebase(&mut self) { + self.allow_rebase = None; + } + + pub fn set_allow_rebase_explicit(&mut self, allow_rebase_explicit: bool) { + self.allow_rebase_explicit = Some(allow_rebase_explicit); + } + + pub fn with_allow_rebase_explicit(mut self, allow_rebase_explicit: bool) -> Repository { + self.allow_rebase_explicit = Some(allow_rebase_explicit); + self + } + + pub fn allow_rebase_explicit(&self) -> Option<&bool> { + self.allow_rebase_explicit.as_ref() + } + + pub fn reset_allow_rebase_explicit(&mut self) { + self.allow_rebase_explicit = None; + } + + pub fn set_allow_squash_merge(&mut self, allow_squash_merge: bool) { + self.allow_squash_merge = Some(allow_squash_merge); + } + + pub fn with_allow_squash_merge(mut self, allow_squash_merge: bool) -> Repository { + self.allow_squash_merge = Some(allow_squash_merge); + self + } + + pub fn allow_squash_merge(&self) -> Option<&bool> { + self.allow_squash_merge.as_ref() + } + + pub fn reset_allow_squash_merge(&mut self) { + self.allow_squash_merge = None; + } + + pub fn set_archived(&mut self, archived: bool) { + self.archived = Some(archived); + } + + pub fn with_archived(mut self, archived: bool) -> Repository { + self.archived = Some(archived); + self + } + + pub fn archived(&self) -> Option<&bool> { + self.archived.as_ref() + } + + pub fn reset_archived(&mut self) { + self.archived = None; + } + + pub fn set_avatar_url(&mut self, avatar_url: String) { + self.avatar_url = Some(avatar_url); + } + + pub fn with_avatar_url(mut self, avatar_url: String) -> Repository { + self.avatar_url = Some(avatar_url); + self + } + + pub fn avatar_url(&self) -> Option<&String> { + self.avatar_url.as_ref() + } + + pub fn reset_avatar_url(&mut self) { + self.avatar_url = None; + } + + pub fn set_clone_url(&mut self, clone_url: String) { + self.clone_url = Some(clone_url); + } + + pub fn with_clone_url(mut self, clone_url: String) -> Repository { + self.clone_url = Some(clone_url); + self + } + + pub fn clone_url(&self) -> Option<&String> { + self.clone_url.as_ref() + } + + pub fn reset_clone_url(&mut self) { + self.clone_url = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> Repository { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_default_branch(&mut self, default_branch: String) { + self.default_branch = Some(default_branch); + } + + pub fn with_default_branch(mut self, default_branch: String) -> Repository { + self.default_branch = Some(default_branch); + self + } + + pub fn default_branch(&self) -> Option<&String> { + self.default_branch.as_ref() + } + + pub fn reset_default_branch(&mut self) { + self.default_branch = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> Repository { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_empty(&mut self, empty: bool) { + self.empty = Some(empty); + } + + pub fn with_empty(mut self, empty: bool) -> Repository { + self.empty = Some(empty); + self + } + + pub fn empty(&self) -> Option<&bool> { + self.empty.as_ref() + } + + pub fn reset_empty(&mut self) { + self.empty = None; + } + + pub fn set_external_tracker(&mut self, external_tracker: ::models::ExternalTracker) { + self.external_tracker = Some(external_tracker); + } + + pub fn with_external_tracker(mut self, external_tracker: ::models::ExternalTracker) -> Repository { + self.external_tracker = Some(external_tracker); + self + } + + pub fn external_tracker(&self) -> Option<&::models::ExternalTracker> { + self.external_tracker.as_ref() + } + + pub fn reset_external_tracker(&mut self) { + self.external_tracker = None; + } + + pub fn set_external_wiki(&mut self, external_wiki: ::models::ExternalWiki) { + self.external_wiki = Some(external_wiki); + } + + pub fn with_external_wiki(mut self, external_wiki: ::models::ExternalWiki) -> Repository { + self.external_wiki = Some(external_wiki); + self + } + + pub fn external_wiki(&self) -> Option<&::models::ExternalWiki> { + self.external_wiki.as_ref() + } + + pub fn reset_external_wiki(&mut self) { + self.external_wiki = None; + } + + pub fn set_fork(&mut self, fork: bool) { + self.fork = Some(fork); + } + + pub fn with_fork(mut self, fork: bool) -> Repository { + self.fork = Some(fork); + self + } + + pub fn fork(&self) -> Option<&bool> { + self.fork.as_ref() + } + + pub fn reset_fork(&mut self) { + self.fork = None; + } + + pub fn set_forks_count(&mut self, forks_count: i64) { + self.forks_count = Some(forks_count); + } + + pub fn with_forks_count(mut self, forks_count: i64) -> Repository { + self.forks_count = Some(forks_count); + self + } + + pub fn forks_count(&self) -> Option<&i64> { + self.forks_count.as_ref() + } + + pub fn reset_forks_count(&mut self) { + self.forks_count = None; + } + + pub fn set_full_name(&mut self, full_name: String) { + self.full_name = Some(full_name); + } + + pub fn with_full_name(mut self, full_name: String) -> Repository { + self.full_name = Some(full_name); + self + } + + pub fn full_name(&self) -> Option<&String> { + self.full_name.as_ref() + } + + pub fn reset_full_name(&mut self) { + self.full_name = None; + } + + pub fn set_has_issues(&mut self, has_issues: bool) { + self.has_issues = Some(has_issues); + } + + pub fn with_has_issues(mut self, has_issues: bool) -> Repository { + self.has_issues = Some(has_issues); + self + } + + pub fn has_issues(&self) -> Option<&bool> { + self.has_issues.as_ref() + } + + pub fn reset_has_issues(&mut self) { + self.has_issues = None; + } + + pub fn set_has_pull_requests(&mut self, has_pull_requests: bool) { + self.has_pull_requests = Some(has_pull_requests); + } + + pub fn with_has_pull_requests(mut self, has_pull_requests: bool) -> Repository { + self.has_pull_requests = Some(has_pull_requests); + self + } + + pub fn has_pull_requests(&self) -> Option<&bool> { + self.has_pull_requests.as_ref() + } + + pub fn reset_has_pull_requests(&mut self) { + self.has_pull_requests = None; + } + + pub fn set_has_wiki(&mut self, has_wiki: bool) { + self.has_wiki = Some(has_wiki); + } + + pub fn with_has_wiki(mut self, has_wiki: bool) -> Repository { + self.has_wiki = Some(has_wiki); + self + } + + pub fn has_wiki(&self) -> Option<&bool> { + self.has_wiki.as_ref() + } + + pub fn reset_has_wiki(&mut self) { + self.has_wiki = None; + } + + pub fn set_html_url(&mut self, html_url: String) { + self.html_url = Some(html_url); + } + + pub fn with_html_url(mut self, html_url: String) -> Repository { + self.html_url = Some(html_url); + self + } + + pub fn html_url(&self) -> Option<&String> { + self.html_url.as_ref() + } + + pub fn reset_html_url(&mut self) { + self.html_url = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Repository { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_ignore_whitespace_conflicts(&mut self, ignore_whitespace_conflicts: bool) { + self.ignore_whitespace_conflicts = Some(ignore_whitespace_conflicts); + } + + pub fn with_ignore_whitespace_conflicts(mut self, ignore_whitespace_conflicts: bool) -> Repository { + self.ignore_whitespace_conflicts = Some(ignore_whitespace_conflicts); + self + } + + pub fn ignore_whitespace_conflicts(&self) -> Option<&bool> { + self.ignore_whitespace_conflicts.as_ref() + } + + pub fn reset_ignore_whitespace_conflicts(&mut self) { + self.ignore_whitespace_conflicts = None; + } + + pub fn set_internal_tracker(&mut self, internal_tracker: ::models::InternalTracker) { + self.internal_tracker = Some(internal_tracker); + } + + pub fn with_internal_tracker(mut self, internal_tracker: ::models::InternalTracker) -> Repository { + self.internal_tracker = Some(internal_tracker); + self + } + + pub fn internal_tracker(&self) -> Option<&::models::InternalTracker> { + self.internal_tracker.as_ref() + } + + pub fn reset_internal_tracker(&mut self) { + self.internal_tracker = None; + } + + pub fn set_mirror(&mut self, mirror: bool) { + self.mirror = Some(mirror); + } + + pub fn with_mirror(mut self, mirror: bool) -> Repository { + self.mirror = Some(mirror); + self + } + + pub fn mirror(&self) -> Option<&bool> { + self.mirror.as_ref() + } + + pub fn reset_mirror(&mut self) { + self.mirror = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> Repository { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_open_issues_count(&mut self, open_issues_count: i64) { + self.open_issues_count = Some(open_issues_count); + } + + pub fn with_open_issues_count(mut self, open_issues_count: i64) -> Repository { + self.open_issues_count = Some(open_issues_count); + self + } + + pub fn open_issues_count(&self) -> Option<&i64> { + self.open_issues_count.as_ref() + } + + pub fn reset_open_issues_count(&mut self) { + self.open_issues_count = None; + } + + pub fn set_open_pr_counter(&mut self, open_pr_counter: i64) { + self.open_pr_counter = Some(open_pr_counter); + } + + pub fn with_open_pr_counter(mut self, open_pr_counter: i64) -> Repository { + self.open_pr_counter = Some(open_pr_counter); + self + } + + pub fn open_pr_counter(&self) -> Option<&i64> { + self.open_pr_counter.as_ref() + } + + pub fn reset_open_pr_counter(&mut self) { + self.open_pr_counter = None; + } + + pub fn set_original_url(&mut self, original_url: String) { + self.original_url = Some(original_url); + } + + pub fn with_original_url(mut self, original_url: String) -> Repository { + self.original_url = Some(original_url); + self + } + + pub fn original_url(&self) -> Option<&String> { + self.original_url.as_ref() + } + + pub fn reset_original_url(&mut self) { + self.original_url = None; + } + + pub fn set_owner(&mut self, owner: ::models::User) { + self.owner = Some(owner); + } + + pub fn with_owner(mut self, owner: ::models::User) -> Repository { + self.owner = Some(owner); + self + } + + pub fn owner(&self) -> Option<&::models::User> { + self.owner.as_ref() + } + + pub fn reset_owner(&mut self) { + self.owner = None; + } + + pub fn set_parent(&mut self, parent: ::models::Repository) { + self.parent = Some(parent); + } + + pub fn with_parent(mut self, parent: ::models::Repository) -> Repository { + self.parent = Some(parent); + self + } + + pub fn parent(&self) -> Option<&::models::Repository> { + self.parent.as_ref() + } + + pub fn reset_parent(&mut self) { + self.parent = None; + } + + pub fn set_permissions(&mut self, permissions: ::models::Permission) { + self.permissions = Some(permissions); + } + + pub fn with_permissions(mut self, permissions: ::models::Permission) -> Repository { + self.permissions = Some(permissions); + self + } + + pub fn permissions(&self) -> Option<&::models::Permission> { + self.permissions.as_ref() + } + + pub fn reset_permissions(&mut self) { + self.permissions = None; + } + + pub fn set_private(&mut self, private: bool) { + self.private = Some(private); + } + + pub fn with_private(mut self, private: bool) -> Repository { + self.private = Some(private); + self + } + + pub fn private(&self) -> Option<&bool> { + self.private.as_ref() + } + + pub fn reset_private(&mut self) { + self.private = None; + } + + pub fn set_release_counter(&mut self, release_counter: i64) { + self.release_counter = Some(release_counter); + } + + pub fn with_release_counter(mut self, release_counter: i64) -> Repository { + self.release_counter = Some(release_counter); + self + } + + pub fn release_counter(&self) -> Option<&i64> { + self.release_counter.as_ref() + } + + pub fn reset_release_counter(&mut self) { + self.release_counter = None; + } + + pub fn set_size(&mut self, size: i64) { + self.size = Some(size); + } + + pub fn with_size(mut self, size: i64) -> Repository { + self.size = Some(size); + self + } + + pub fn size(&self) -> Option<&i64> { + self.size.as_ref() + } + + pub fn reset_size(&mut self) { + self.size = None; + } + + pub fn set_ssh_url(&mut self, ssh_url: String) { + self.ssh_url = Some(ssh_url); + } + + pub fn with_ssh_url(mut self, ssh_url: String) -> Repository { + self.ssh_url = Some(ssh_url); + self + } + + pub fn ssh_url(&self) -> Option<&String> { + self.ssh_url.as_ref() + } + + pub fn reset_ssh_url(&mut self) { + self.ssh_url = None; + } + + pub fn set_stars_count(&mut self, stars_count: i64) { + self.stars_count = Some(stars_count); + } + + pub fn with_stars_count(mut self, stars_count: i64) -> Repository { + self.stars_count = Some(stars_count); + self + } + + pub fn stars_count(&self) -> Option<&i64> { + self.stars_count.as_ref() + } + + pub fn reset_stars_count(&mut self) { + self.stars_count = None; + } + + pub fn set_template(&mut self, template: bool) { + self.template = Some(template); + } + + pub fn with_template(mut self, template: bool) -> Repository { + self.template = Some(template); + self + } + + pub fn template(&self) -> Option<&bool> { + self.template.as_ref() + } + + pub fn reset_template(&mut self) { + self.template = None; + } + + pub fn set_updated_at(&mut self, updated_at: String) { + self.updated_at = Some(updated_at); + } + + pub fn with_updated_at(mut self, updated_at: String) -> Repository { + self.updated_at = Some(updated_at); + self + } + + pub fn updated_at(&self) -> Option<&String> { + self.updated_at.as_ref() + } + + pub fn reset_updated_at(&mut self) { + self.updated_at = None; + } + + pub fn set_watchers_count(&mut self, watchers_count: i64) { + self.watchers_count = Some(watchers_count); + } + + pub fn with_watchers_count(mut self, watchers_count: i64) -> Repository { + self.watchers_count = Some(watchers_count); + self + } + + pub fn watchers_count(&self) -> Option<&i64> { + self.watchers_count.as_ref() + } + + pub fn reset_watchers_count(&mut self) { + self.watchers_count = None; + } + + pub fn set_website(&mut self, website: String) { + self.website = Some(website); + } + + pub fn with_website(mut self, website: String) -> Repository { + self.website = Some(website); + self + } + + pub fn website(&self) -> Option<&String> { + self.website.as_ref() + } + + pub fn reset_website(&mut self) { + self.website = None; + } + +} + + + diff --git a/src/models/repository_meta.rs b/src/models/repository_meta.rs new file mode 100644 index 0000000..0159d0b --- /dev/null +++ b/src/models/repository_meta.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// RepositoryMeta : RepositoryMeta basic repository information + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct RepositoryMeta { + #[serde(rename = "full_name")] + full_name: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "name")] + name: Option +} + +impl RepositoryMeta { + /// RepositoryMeta basic repository information + pub fn new() -> RepositoryMeta { + RepositoryMeta { + full_name: None, + id: None, + name: None + } + } + + pub fn set_full_name(&mut self, full_name: String) { + self.full_name = Some(full_name); + } + + pub fn with_full_name(mut self, full_name: String) -> RepositoryMeta { + self.full_name = Some(full_name); + self + } + + pub fn full_name(&self) -> Option<&String> { + self.full_name.as_ref() + } + + pub fn reset_full_name(&mut self) { + self.full_name = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> RepositoryMeta { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> RepositoryMeta { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + +} + + + diff --git a/src/models/search_results.rs b/src/models/search_results.rs new file mode 100644 index 0000000..7bc1940 --- /dev/null +++ b/src/models/search_results.rs @@ -0,0 +1,70 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// SearchResults : SearchResults results of a successful search + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct SearchResults { + #[serde(rename = "data")] + data: Option>, + #[serde(rename = "ok")] + ok: Option +} + +impl SearchResults { + /// SearchResults results of a successful search + pub fn new() -> SearchResults { + SearchResults { + data: None, + ok: None + } + } + + pub fn set_data(&mut self, data: Vec<::models::Repository>) { + self.data = Some(data); + } + + pub fn with_data(mut self, data: Vec<::models::Repository>) -> SearchResults { + self.data = Some(data); + self + } + + pub fn data(&self) -> Option<&Vec<::models::Repository>> { + self.data.as_ref() + } + + pub fn reset_data(&mut self) { + self.data = None; + } + + pub fn set_ok(&mut self, ok: bool) { + self.ok = Some(ok); + } + + pub fn with_ok(mut self, ok: bool) -> SearchResults { + self.ok = Some(ok); + self + } + + pub fn ok(&self) -> Option<&bool> { + self.ok.as_ref() + } + + pub fn reset_ok(&mut self) { + self.ok = None; + } + +} + + + diff --git a/src/models/server_version.rs b/src/models/server_version.rs new file mode 100644 index 0000000..ac45050 --- /dev/null +++ b/src/models/server_version.rs @@ -0,0 +1,50 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// ServerVersion : ServerVersion wraps the version of the server + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct ServerVersion { + #[serde(rename = "version")] + version: Option +} + +impl ServerVersion { + /// ServerVersion wraps the version of the server + pub fn new() -> ServerVersion { + ServerVersion { + version: None + } + } + + pub fn set_version(&mut self, version: String) { + self.version = Some(version); + } + + pub fn with_version(mut self, version: String) -> ServerVersion { + self.version = Some(version); + self + } + + pub fn version(&self) -> Option<&String> { + self.version.as_ref() + } + + pub fn reset_version(&mut self) { + self.version = None; + } + +} + + + diff --git a/src/models/state_type.rs b/src/models/state_type.rs new file mode 100644 index 0000000..399a259 --- /dev/null +++ b/src/models/state_type.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// StateType : StateType issue state type + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct StateType { +} + +impl StateType { + /// StateType issue state type + pub fn new() -> StateType { + StateType { + } + } + +} + + + diff --git a/src/models/status.rs b/src/models/status.rs new file mode 100644 index 0000000..eaf7a23 --- /dev/null +++ b/src/models/status.rs @@ -0,0 +1,210 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Status : Status holds a single Status of a single Commit + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Status { + #[serde(rename = "context")] + context: Option, + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "creator")] + creator: Option<::models::User>, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "status")] + status: Option<::models::StatusState>, + #[serde(rename = "target_url")] + target_url: Option, + #[serde(rename = "updated_at")] + updated_at: Option, + #[serde(rename = "url")] + url: Option +} + +impl Status { + /// Status holds a single Status of a single Commit + pub fn new() -> Status { + Status { + context: None, + created_at: None, + creator: None, + description: None, + id: None, + status: None, + target_url: None, + updated_at: None, + url: None + } + } + + pub fn set_context(&mut self, context: String) { + self.context = Some(context); + } + + pub fn with_context(mut self, context: String) -> Status { + self.context = Some(context); + self + } + + pub fn context(&self) -> Option<&String> { + self.context.as_ref() + } + + pub fn reset_context(&mut self) { + self.context = None; + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> Status { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_creator(&mut self, creator: ::models::User) { + self.creator = Some(creator); + } + + pub fn with_creator(mut self, creator: ::models::User) -> Status { + self.creator = Some(creator); + self + } + + pub fn creator(&self) -> Option<&::models::User> { + self.creator.as_ref() + } + + pub fn reset_creator(&mut self) { + self.creator = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> Status { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Status { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_status(&mut self, status: ::models::StatusState) { + self.status = Some(status); + } + + pub fn with_status(mut self, status: ::models::StatusState) -> Status { + self.status = Some(status); + self + } + + pub fn status(&self) -> Option<&::models::StatusState> { + self.status.as_ref() + } + + pub fn reset_status(&mut self) { + self.status = None; + } + + pub fn set_target_url(&mut self, target_url: String) { + self.target_url = Some(target_url); + } + + pub fn with_target_url(mut self, target_url: String) -> Status { + self.target_url = Some(target_url); + self + } + + pub fn target_url(&self) -> Option<&String> { + self.target_url.as_ref() + } + + pub fn reset_target_url(&mut self) { + self.target_url = None; + } + + pub fn set_updated_at(&mut self, updated_at: String) { + self.updated_at = Some(updated_at); + } + + pub fn with_updated_at(mut self, updated_at: String) -> Status { + self.updated_at = Some(updated_at); + self + } + + pub fn updated_at(&self) -> Option<&String> { + self.updated_at.as_ref() + } + + pub fn reset_updated_at(&mut self) { + self.updated_at = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> Status { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + + diff --git a/src/models/status_state.rs b/src/models/status_state.rs new file mode 100644 index 0000000..da7c22d --- /dev/null +++ b/src/models/status_state.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// StatusState : StatusState holds the state of a Status It can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\" + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct StatusState { +} + +impl StatusState { + /// StatusState holds the state of a Status It can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\" + pub fn new() -> StatusState { + StatusState { + } + } + +} + + + diff --git a/src/models/stop_watch.rs b/src/models/stop_watch.rs new file mode 100644 index 0000000..b93ea61 --- /dev/null +++ b/src/models/stop_watch.rs @@ -0,0 +1,70 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// StopWatch : StopWatch represent a running stopwatch + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct StopWatch { + #[serde(rename = "created")] + created: Option, + #[serde(rename = "issue_index")] + issue_index: Option +} + +impl StopWatch { + /// StopWatch represent a running stopwatch + pub fn new() -> StopWatch { + StopWatch { + created: None, + issue_index: None + } + } + + pub fn set_created(&mut self, created: String) { + self.created = Some(created); + } + + pub fn with_created(mut self, created: String) -> StopWatch { + self.created = Some(created); + self + } + + pub fn created(&self) -> Option<&String> { + self.created.as_ref() + } + + pub fn reset_created(&mut self) { + self.created = None; + } + + pub fn set_issue_index(&mut self, issue_index: i64) { + self.issue_index = Some(issue_index); + } + + pub fn with_issue_index(mut self, issue_index: i64) -> StopWatch { + self.issue_index = Some(issue_index); + self + } + + pub fn issue_index(&self) -> Option<&i64> { + self.issue_index.as_ref() + } + + pub fn reset_issue_index(&mut self) { + self.issue_index = None; + } + +} + + + diff --git a/src/models/tag.rs b/src/models/tag.rs new file mode 100644 index 0000000..f5b7f9c --- /dev/null +++ b/src/models/tag.rs @@ -0,0 +1,130 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Tag : Tag represents a repository tag + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Tag { + #[serde(rename = "commit")] + commit: Option<::models::CommitMeta>, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "tarball_url")] + tarball_url: Option, + #[serde(rename = "zipball_url")] + zipball_url: Option +} + +impl Tag { + /// Tag represents a repository tag + pub fn new() -> Tag { + Tag { + commit: None, + id: None, + name: None, + tarball_url: None, + zipball_url: None + } + } + + pub fn set_commit(&mut self, commit: ::models::CommitMeta) { + self.commit = Some(commit); + } + + pub fn with_commit(mut self, commit: ::models::CommitMeta) -> Tag { + self.commit = Some(commit); + self + } + + pub fn commit(&self) -> Option<&::models::CommitMeta> { + self.commit.as_ref() + } + + pub fn reset_commit(&mut self) { + self.commit = None; + } + + pub fn set_id(&mut self, id: String) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: String) -> Tag { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&String> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> Tag { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_tarball_url(&mut self, tarball_url: String) { + self.tarball_url = Some(tarball_url); + } + + pub fn with_tarball_url(mut self, tarball_url: String) -> Tag { + self.tarball_url = Some(tarball_url); + self + } + + pub fn tarball_url(&self) -> Option<&String> { + self.tarball_url.as_ref() + } + + pub fn reset_tarball_url(&mut self) { + self.tarball_url = None; + } + + pub fn set_zipball_url(&mut self, zipball_url: String) { + self.zipball_url = Some(zipball_url); + } + + pub fn with_zipball_url(mut self, zipball_url: String) -> Tag { + self.zipball_url = Some(zipball_url); + self + } + + pub fn zipball_url(&self) -> Option<&String> { + self.zipball_url.as_ref() + } + + pub fn reset_zipball_url(&mut self) { + self.zipball_url = None; + } + +} + + + diff --git a/src/models/team.rs b/src/models/team.rs new file mode 100644 index 0000000..f92ebe8 --- /dev/null +++ b/src/models/team.rs @@ -0,0 +1,190 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// Team : Team represents a team in an organization + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Team { + #[serde(rename = "can_create_org_repo")] + can_create_org_repo: Option, + #[serde(rename = "description")] + description: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "includes_all_repositories")] + includes_all_repositories: Option, + #[serde(rename = "name")] + name: Option, + #[serde(rename = "organization")] + organization: Option<::models::Organization>, + #[serde(rename = "permission")] + permission: Option, + #[serde(rename = "units")] + units: Option> +} + +impl Team { + /// Team represents a team in an organization + pub fn new() -> Team { + Team { + can_create_org_repo: None, + description: None, + id: None, + includes_all_repositories: None, + name: None, + organization: None, + permission: None, + units: None + } + } + + pub fn set_can_create_org_repo(&mut self, can_create_org_repo: bool) { + self.can_create_org_repo = Some(can_create_org_repo); + } + + pub fn with_can_create_org_repo(mut self, can_create_org_repo: bool) -> Team { + self.can_create_org_repo = Some(can_create_org_repo); + self + } + + pub fn can_create_org_repo(&self) -> Option<&bool> { + self.can_create_org_repo.as_ref() + } + + pub fn reset_can_create_org_repo(&mut self) { + self.can_create_org_repo = None; + } + + pub fn set_description(&mut self, description: String) { + self.description = Some(description); + } + + pub fn with_description(mut self, description: String) -> Team { + self.description = Some(description); + self + } + + pub fn description(&self) -> Option<&String> { + self.description.as_ref() + } + + pub fn reset_description(&mut self) { + self.description = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> Team { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_includes_all_repositories(&mut self, includes_all_repositories: bool) { + self.includes_all_repositories = Some(includes_all_repositories); + } + + pub fn with_includes_all_repositories(mut self, includes_all_repositories: bool) -> Team { + self.includes_all_repositories = Some(includes_all_repositories); + self + } + + pub fn includes_all_repositories(&self) -> Option<&bool> { + self.includes_all_repositories.as_ref() + } + + pub fn reset_includes_all_repositories(&mut self) { + self.includes_all_repositories = None; + } + + pub fn set_name(&mut self, name: String) { + self.name = Some(name); + } + + pub fn with_name(mut self, name: String) -> Team { + self.name = Some(name); + self + } + + pub fn name(&self) -> Option<&String> { + self.name.as_ref() + } + + pub fn reset_name(&mut self) { + self.name = None; + } + + pub fn set_organization(&mut self, organization: ::models::Organization) { + self.organization = Some(organization); + } + + pub fn with_organization(mut self, organization: ::models::Organization) -> Team { + self.organization = Some(organization); + self + } + + pub fn organization(&self) -> Option<&::models::Organization> { + self.organization.as_ref() + } + + pub fn reset_organization(&mut self) { + self.organization = None; + } + + pub fn set_permission(&mut self, permission: String) { + self.permission = Some(permission); + } + + pub fn with_permission(mut self, permission: String) -> Team { + self.permission = Some(permission); + self + } + + pub fn permission(&self) -> Option<&String> { + self.permission.as_ref() + } + + pub fn reset_permission(&mut self) { + self.permission = None; + } + + pub fn set_units(&mut self, units: Vec) { + self.units = Some(units); + } + + pub fn with_units(mut self, units: Vec) -> Team { + self.units = Some(units); + self + } + + pub fn units(&self) -> Option<&Vec> { + self.units.as_ref() + } + + pub fn reset_units(&mut self) { + self.units = None; + } + +} + + + diff --git a/src/models/time_stamp.rs b/src/models/time_stamp.rs new file mode 100644 index 0000000..6a506f2 --- /dev/null +++ b/src/models/time_stamp.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// TimeStamp : TimeStamp defines a timestamp + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct TimeStamp { +} + +impl TimeStamp { + /// TimeStamp defines a timestamp + pub fn new() -> TimeStamp { + TimeStamp { + } + } + +} + + + diff --git a/src/models/topic_name.rs b/src/models/topic_name.rs new file mode 100644 index 0000000..77ff355 --- /dev/null +++ b/src/models/topic_name.rs @@ -0,0 +1,50 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// TopicName : TopicName a list of repo topic names + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct TopicName { + #[serde(rename = "topics")] + topics: Option> +} + +impl TopicName { + /// TopicName a list of repo topic names + pub fn new() -> TopicName { + TopicName { + topics: None + } + } + + pub fn set_topics(&mut self, topics: Vec) { + self.topics = Some(topics); + } + + pub fn with_topics(mut self, topics: Vec) -> TopicName { + self.topics = Some(topics); + self + } + + pub fn topics(&self) -> Option<&Vec> { + self.topics.as_ref() + } + + pub fn reset_topics(&mut self) { + self.topics = None; + } + +} + + + diff --git a/src/models/topic_response.rs b/src/models/topic_response.rs new file mode 100644 index 0000000..828aa90 --- /dev/null +++ b/src/models/topic_response.rs @@ -0,0 +1,130 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// TopicResponse : TopicResponse for returning topics + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct TopicResponse { + #[serde(rename = "created")] + created: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "repo_count")] + repo_count: Option, + #[serde(rename = "topic_name")] + topic_name: Option, + #[serde(rename = "updated")] + updated: Option +} + +impl TopicResponse { + /// TopicResponse for returning topics + pub fn new() -> TopicResponse { + TopicResponse { + created: None, + id: None, + repo_count: None, + topic_name: None, + updated: None + } + } + + pub fn set_created(&mut self, created: String) { + self.created = Some(created); + } + + pub fn with_created(mut self, created: String) -> TopicResponse { + self.created = Some(created); + self + } + + pub fn created(&self) -> Option<&String> { + self.created.as_ref() + } + + pub fn reset_created(&mut self) { + self.created = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> TopicResponse { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_repo_count(&mut self, repo_count: i64) { + self.repo_count = Some(repo_count); + } + + pub fn with_repo_count(mut self, repo_count: i64) -> TopicResponse { + self.repo_count = Some(repo_count); + self + } + + pub fn repo_count(&self) -> Option<&i64> { + self.repo_count.as_ref() + } + + pub fn reset_repo_count(&mut self) { + self.repo_count = None; + } + + pub fn set_topic_name(&mut self, topic_name: String) { + self.topic_name = Some(topic_name); + } + + pub fn with_topic_name(mut self, topic_name: String) -> TopicResponse { + self.topic_name = Some(topic_name); + self + } + + pub fn topic_name(&self) -> Option<&String> { + self.topic_name.as_ref() + } + + pub fn reset_topic_name(&mut self) { + self.topic_name = None; + } + + pub fn set_updated(&mut self, updated: String) { + self.updated = Some(updated); + } + + pub fn with_updated(mut self, updated: String) -> TopicResponse { + self.updated = Some(updated); + self + } + + pub fn updated(&self) -> Option<&String> { + self.updated.as_ref() + } + + pub fn reset_updated(&mut self) { + self.updated = None; + } + +} + + + diff --git a/src/models/tracked_time.rs b/src/models/tracked_time.rs new file mode 100644 index 0000000..d8f89a6 --- /dev/null +++ b/src/models/tracked_time.rs @@ -0,0 +1,173 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// TrackedTime : TrackedTime worked time for an issue / pr + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct TrackedTime { + #[serde(rename = "created")] + created: Option, + #[serde(rename = "id")] + id: Option, + #[serde(rename = "issue")] + issue: Option<::models::Issue>, + /// deprecated (only for backwards compatibility) + #[serde(rename = "issue_id")] + issue_id: Option, + /// Time in seconds + #[serde(rename = "time")] + time: Option, + /// deprecated (only for backwards compatibility) + #[serde(rename = "user_id")] + user_id: Option, + #[serde(rename = "user_name")] + user_name: Option +} + +impl TrackedTime { + /// TrackedTime worked time for an issue / pr + pub fn new() -> TrackedTime { + TrackedTime { + created: None, + id: None, + issue: None, + issue_id: None, + time: None, + user_id: None, + user_name: None + } + } + + pub fn set_created(&mut self, created: String) { + self.created = Some(created); + } + + pub fn with_created(mut self, created: String) -> TrackedTime { + self.created = Some(created); + self + } + + pub fn created(&self) -> Option<&String> { + self.created.as_ref() + } + + pub fn reset_created(&mut self) { + self.created = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> TrackedTime { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_issue(&mut self, issue: ::models::Issue) { + self.issue = Some(issue); + } + + pub fn with_issue(mut self, issue: ::models::Issue) -> TrackedTime { + self.issue = Some(issue); + self + } + + pub fn issue(&self) -> Option<&::models::Issue> { + self.issue.as_ref() + } + + pub fn reset_issue(&mut self) { + self.issue = None; + } + + pub fn set_issue_id(&mut self, issue_id: i64) { + self.issue_id = Some(issue_id); + } + + pub fn with_issue_id(mut self, issue_id: i64) -> TrackedTime { + self.issue_id = Some(issue_id); + self + } + + pub fn issue_id(&self) -> Option<&i64> { + self.issue_id.as_ref() + } + + pub fn reset_issue_id(&mut self) { + self.issue_id = None; + } + + pub fn set_time(&mut self, time: i64) { + self.time = Some(time); + } + + pub fn with_time(mut self, time: i64) -> TrackedTime { + self.time = Some(time); + self + } + + pub fn time(&self) -> Option<&i64> { + self.time.as_ref() + } + + pub fn reset_time(&mut self) { + self.time = None; + } + + pub fn set_user_id(&mut self, user_id: i64) { + self.user_id = Some(user_id); + } + + pub fn with_user_id(mut self, user_id: i64) -> TrackedTime { + self.user_id = Some(user_id); + self + } + + pub fn user_id(&self) -> Option<&i64> { + self.user_id.as_ref() + } + + pub fn reset_user_id(&mut self) { + self.user_id = None; + } + + pub fn set_user_name(&mut self, user_name: String) { + self.user_name = Some(user_name); + } + + pub fn with_user_name(mut self, user_name: String) -> TrackedTime { + self.user_name = Some(user_name); + self + } + + pub fn user_name(&self) -> Option<&String> { + self.user_name.as_ref() + } + + pub fn reset_user_name(&mut self) { + self.user_name = None; + } + +} + + + diff --git a/src/models/update_file_options.rs b/src/models/update_file_options.rs new file mode 100644 index 0000000..edc0c35 --- /dev/null +++ b/src/models/update_file_options.rs @@ -0,0 +1,210 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// UpdateFileOptions : UpdateFileOptions options for updating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct UpdateFileOptions { + #[serde(rename = "author")] + author: Option<::models::Identity>, + /// branch (optional) to base this file from. if not given, the default branch is used + #[serde(rename = "branch")] + branch: Option, + #[serde(rename = "committer")] + committer: Option<::models::Identity>, + /// content must be base64 encoded + #[serde(rename = "content")] + content: String, + #[serde(rename = "dates")] + dates: Option<::models::CommitDateOptions>, + /// from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL + #[serde(rename = "from_path")] + from_path: Option, + /// message (optional) for the commit of this file. if not supplied, a default message will be used + #[serde(rename = "message")] + message: Option, + /// new_branch (optional) will make a new branch from `branch` before creating the file + #[serde(rename = "new_branch")] + new_branch: Option, + /// sha is the SHA for the file that already exists + #[serde(rename = "sha")] + sha: String +} + +impl UpdateFileOptions { + /// UpdateFileOptions options for updating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + pub fn new(content: String, sha: String) -> UpdateFileOptions { + UpdateFileOptions { + author: None, + branch: None, + committer: None, + content: content, + dates: None, + from_path: None, + message: None, + new_branch: None, + sha: sha + } + } + + pub fn set_author(&mut self, author: ::models::Identity) { + self.author = Some(author); + } + + pub fn with_author(mut self, author: ::models::Identity) -> UpdateFileOptions { + self.author = Some(author); + self + } + + pub fn author(&self) -> Option<&::models::Identity> { + self.author.as_ref() + } + + pub fn reset_author(&mut self) { + self.author = None; + } + + pub fn set_branch(&mut self, branch: String) { + self.branch = Some(branch); + } + + pub fn with_branch(mut self, branch: String) -> UpdateFileOptions { + self.branch = Some(branch); + self + } + + pub fn branch(&self) -> Option<&String> { + self.branch.as_ref() + } + + pub fn reset_branch(&mut self) { + self.branch = None; + } + + pub fn set_committer(&mut self, committer: ::models::Identity) { + self.committer = Some(committer); + } + + pub fn with_committer(mut self, committer: ::models::Identity) -> UpdateFileOptions { + self.committer = Some(committer); + self + } + + pub fn committer(&self) -> Option<&::models::Identity> { + self.committer.as_ref() + } + + pub fn reset_committer(&mut self) { + self.committer = None; + } + + pub fn set_content(&mut self, content: String) { + self.content = content; + } + + pub fn with_content(mut self, content: String) -> UpdateFileOptions { + self.content = content; + self + } + + pub fn content(&self) -> &String { + &self.content + } + + + pub fn set_dates(&mut self, dates: ::models::CommitDateOptions) { + self.dates = Some(dates); + } + + pub fn with_dates(mut self, dates: ::models::CommitDateOptions) -> UpdateFileOptions { + self.dates = Some(dates); + self + } + + pub fn dates(&self) -> Option<&::models::CommitDateOptions> { + self.dates.as_ref() + } + + pub fn reset_dates(&mut self) { + self.dates = None; + } + + pub fn set_from_path(&mut self, from_path: String) { + self.from_path = Some(from_path); + } + + pub fn with_from_path(mut self, from_path: String) -> UpdateFileOptions { + self.from_path = Some(from_path); + self + } + + pub fn from_path(&self) -> Option<&String> { + self.from_path.as_ref() + } + + pub fn reset_from_path(&mut self) { + self.from_path = None; + } + + pub fn set_message(&mut self, message: String) { + self.message = Some(message); + } + + pub fn with_message(mut self, message: String) -> UpdateFileOptions { + self.message = Some(message); + self + } + + pub fn message(&self) -> Option<&String> { + self.message.as_ref() + } + + pub fn reset_message(&mut self) { + self.message = None; + } + + pub fn set_new_branch(&mut self, new_branch: String) { + self.new_branch = Some(new_branch); + } + + pub fn with_new_branch(mut self, new_branch: String) -> UpdateFileOptions { + self.new_branch = Some(new_branch); + self + } + + pub fn new_branch(&self) -> Option<&String> { + self.new_branch.as_ref() + } + + pub fn reset_new_branch(&mut self) { + self.new_branch = None; + } + + pub fn set_sha(&mut self, sha: String) { + self.sha = sha; + } + + pub fn with_sha(mut self, sha: String) -> UpdateFileOptions { + self.sha = sha; + self + } + + pub fn sha(&self) -> &String { + &self.sha + } + + +} + + + diff --git a/src/models/user.rs b/src/models/user.rs new file mode 100644 index 0000000..143dd7e --- /dev/null +++ b/src/models/user.rs @@ -0,0 +1,216 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// User : User represents a user + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct User { + /// URL to the user's avatar + #[serde(rename = "avatar_url")] + avatar_url: Option, + #[serde(rename = "created")] + created: Option, + #[serde(rename = "email")] + email: Option, + /// the user's full name + #[serde(rename = "full_name")] + full_name: Option, + /// the user's id + #[serde(rename = "id")] + id: Option, + /// Is the user an administrator + #[serde(rename = "is_admin")] + is_admin: Option, + /// User locale + #[serde(rename = "language")] + language: Option, + #[serde(rename = "last_login")] + last_login: Option, + /// the user's username + #[serde(rename = "login")] + login: Option +} + +impl User { + /// User represents a user + pub fn new() -> User { + User { + avatar_url: None, + created: None, + email: None, + full_name: None, + id: None, + is_admin: None, + language: None, + last_login: None, + login: None + } + } + + pub fn set_avatar_url(&mut self, avatar_url: String) { + self.avatar_url = Some(avatar_url); + } + + pub fn with_avatar_url(mut self, avatar_url: String) -> User { + self.avatar_url = Some(avatar_url); + self + } + + pub fn avatar_url(&self) -> Option<&String> { + self.avatar_url.as_ref() + } + + pub fn reset_avatar_url(&mut self) { + self.avatar_url = None; + } + + pub fn set_created(&mut self, created: String) { + self.created = Some(created); + } + + pub fn with_created(mut self, created: String) -> User { + self.created = Some(created); + self + } + + pub fn created(&self) -> Option<&String> { + self.created.as_ref() + } + + pub fn reset_created(&mut self) { + self.created = None; + } + + pub fn set_email(&mut self, email: String) { + self.email = Some(email); + } + + pub fn with_email(mut self, email: String) -> User { + self.email = Some(email); + self + } + + pub fn email(&self) -> Option<&String> { + self.email.as_ref() + } + + pub fn reset_email(&mut self) { + self.email = None; + } + + pub fn set_full_name(&mut self, full_name: String) { + self.full_name = Some(full_name); + } + + pub fn with_full_name(mut self, full_name: String) -> User { + self.full_name = Some(full_name); + self + } + + pub fn full_name(&self) -> Option<&String> { + self.full_name.as_ref() + } + + pub fn reset_full_name(&mut self) { + self.full_name = None; + } + + pub fn set_id(&mut self, id: i64) { + self.id = Some(id); + } + + pub fn with_id(mut self, id: i64) -> User { + self.id = Some(id); + self + } + + pub fn id(&self) -> Option<&i64> { + self.id.as_ref() + } + + pub fn reset_id(&mut self) { + self.id = None; + } + + pub fn set_is_admin(&mut self, is_admin: bool) { + self.is_admin = Some(is_admin); + } + + pub fn with_is_admin(mut self, is_admin: bool) -> User { + self.is_admin = Some(is_admin); + self + } + + pub fn is_admin(&self) -> Option<&bool> { + self.is_admin.as_ref() + } + + pub fn reset_is_admin(&mut self) { + self.is_admin = None; + } + + pub fn set_language(&mut self, language: String) { + self.language = Some(language); + } + + pub fn with_language(mut self, language: String) -> User { + self.language = Some(language); + self + } + + pub fn language(&self) -> Option<&String> { + self.language.as_ref() + } + + pub fn reset_language(&mut self) { + self.language = None; + } + + pub fn set_last_login(&mut self, last_login: String) { + self.last_login = Some(last_login); + } + + pub fn with_last_login(mut self, last_login: String) -> User { + self.last_login = Some(last_login); + self + } + + pub fn last_login(&self) -> Option<&String> { + self.last_login.as_ref() + } + + pub fn reset_last_login(&mut self) { + self.last_login = None; + } + + pub fn set_login(&mut self, login: String) { + self.login = Some(login); + } + + pub fn with_login(mut self, login: String) -> User { + self.login = Some(login); + self + } + + pub fn login(&self) -> Option<&String> { + self.login.as_ref() + } + + pub fn reset_login(&mut self) { + self.login = None; + } + +} + + + diff --git a/src/models/user_heatmap_data.rs b/src/models/user_heatmap_data.rs new file mode 100644 index 0000000..cb60b7f --- /dev/null +++ b/src/models/user_heatmap_data.rs @@ -0,0 +1,70 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// UserHeatmapData : UserHeatmapData represents the data needed to create a heatmap + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct UserHeatmapData { + #[serde(rename = "contributions")] + contributions: Option, + #[serde(rename = "timestamp")] + timestamp: Option<::models::TimeStamp> +} + +impl UserHeatmapData { + /// UserHeatmapData represents the data needed to create a heatmap + pub fn new() -> UserHeatmapData { + UserHeatmapData { + contributions: None, + timestamp: None + } + } + + pub fn set_contributions(&mut self, contributions: i64) { + self.contributions = Some(contributions); + } + + pub fn with_contributions(mut self, contributions: i64) -> UserHeatmapData { + self.contributions = Some(contributions); + self + } + + pub fn contributions(&self) -> Option<&i64> { + self.contributions.as_ref() + } + + pub fn reset_contributions(&mut self) { + self.contributions = None; + } + + pub fn set_timestamp(&mut self, timestamp: ::models::TimeStamp) { + self.timestamp = Some(timestamp); + } + + pub fn with_timestamp(mut self, timestamp: ::models::TimeStamp) -> UserHeatmapData { + self.timestamp = Some(timestamp); + self + } + + pub fn timestamp(&self) -> Option<&::models::TimeStamp> { + self.timestamp.as_ref() + } + + pub fn reset_timestamp(&mut self) { + self.timestamp = None; + } + +} + + + diff --git a/src/models/watch_info.rs b/src/models/watch_info.rs new file mode 100644 index 0000000..78fadb2 --- /dev/null +++ b/src/models/watch_info.rs @@ -0,0 +1,150 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * OpenAPI spec version: 1.1.1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +/// WatchInfo : WatchInfo represents an API watch status of one repository + +#[allow(unused_imports)] +use serde_json::Value; + +#[derive(Debug, Serialize, Deserialize)] +pub struct WatchInfo { + #[serde(rename = "created_at")] + created_at: Option, + #[serde(rename = "ignored")] + ignored: Option, + #[serde(rename = "reason")] + reason: Option, + #[serde(rename = "repository_url")] + repository_url: Option, + #[serde(rename = "subscribed")] + subscribed: Option, + #[serde(rename = "url")] + url: Option +} + +impl WatchInfo { + /// WatchInfo represents an API watch status of one repository + pub fn new() -> WatchInfo { + WatchInfo { + created_at: None, + ignored: None, + reason: None, + repository_url: None, + subscribed: None, + url: None + } + } + + pub fn set_created_at(&mut self, created_at: String) { + self.created_at = Some(created_at); + } + + pub fn with_created_at(mut self, created_at: String) -> WatchInfo { + self.created_at = Some(created_at); + self + } + + pub fn created_at(&self) -> Option<&String> { + self.created_at.as_ref() + } + + pub fn reset_created_at(&mut self) { + self.created_at = None; + } + + pub fn set_ignored(&mut self, ignored: bool) { + self.ignored = Some(ignored); + } + + pub fn with_ignored(mut self, ignored: bool) -> WatchInfo { + self.ignored = Some(ignored); + self + } + + pub fn ignored(&self) -> Option<&bool> { + self.ignored.as_ref() + } + + pub fn reset_ignored(&mut self) { + self.ignored = None; + } + + pub fn set_reason(&mut self, reason: Value) { + self.reason = Some(reason); + } + + pub fn with_reason(mut self, reason: Value) -> WatchInfo { + self.reason = Some(reason); + self + } + + pub fn reason(&self) -> Option<&Value> { + self.reason.as_ref() + } + + pub fn reset_reason(&mut self) { + self.reason = None; + } + + pub fn set_repository_url(&mut self, repository_url: String) { + self.repository_url = Some(repository_url); + } + + pub fn with_repository_url(mut self, repository_url: String) -> WatchInfo { + self.repository_url = Some(repository_url); + self + } + + pub fn repository_url(&self) -> Option<&String> { + self.repository_url.as_ref() + } + + pub fn reset_repository_url(&mut self) { + self.repository_url = None; + } + + pub fn set_subscribed(&mut self, subscribed: bool) { + self.subscribed = Some(subscribed); + } + + pub fn with_subscribed(mut self, subscribed: bool) -> WatchInfo { + self.subscribed = Some(subscribed); + self + } + + pub fn subscribed(&self) -> Option<&bool> { + self.subscribed.as_ref() + } + + pub fn reset_subscribed(&mut self) { + self.subscribed = None; + } + + pub fn set_url(&mut self, url: String) { + self.url = Some(url); + } + + pub fn with_url(mut self, url: String) -> WatchInfo { + self.url = Some(url); + self + } + + pub fn url(&self) -> Option<&String> { + self.url.as_ref() + } + + pub fn reset_url(&mut self) { + self.url = None; + } + +} + + +