/
nekstep
/
gvcli
Обзор
Документация
Войти
/
nekstep
/
gvcli
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
internal/generated-api/client.go
5 604 строки
209 KB
kst
feat: implement PR management (view, files, comments, diff, merge --check, list filters)
26 июл 2026, 19:43
26 июл 2026, 19:43
35a5ed9
Код
Авторство
О чём код?
// Package generated_api provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT. package generated_api import ( "bytes" "context" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" "github.com/oapi-codegen/runtime" openapi_types "github.com/oapi-codegen/runtime/types" ) // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. // // The standard http.Client implements this interface. type HttpRequestDoer interface { Do(req *http.Request) (*http.Response, error) } // Client which conforms to the OpenAPI3 specification for this service. type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn } // ClientOption allows setting custom parameters during construction type ClientOption func(*Client) error // Creates a new Client, with reasonable defaults func NewClient(server string, opts ...ClientOption) (*Client, error) { // create a client with sane default values client := Client{ Server: server, } // mutate client and add all optional params for _, o := range opts { if err := o(&client); err != nil { return nil, err } } // ensure the server URL always has a trailing slash if !strings.HasSuffix(client.Server, "/") { client.Server += "/" } // create httpClient, if not already present if client.Client == nil { client.Client = &http.Client{} } return &client, nil } // WithHTTPClient allows overriding the default Doer, which is // automatically created using http.Client. This is useful for tests. func WithHTTPClient(doer HttpRequestDoer) ClientOption { return func(c *Client) error { c.Client = doer return nil } } // WithRequestEditorFn allows setting up a callback function, which will be // called right before sending the request. This can be used to mutate the request. func WithRequestEditorFn(fn RequestEditorFn) ClientOption { return func(c *Client) error { c.RequestEditors = append(c.RequestEditors, fn) return nil } } // The interface specification for the client above. type ClientInterface interface { // GetReposOwnerRepo Получить информацию о репозитории // // Возвращает основные данные о репозитории: название, владельца, настройки, права пользователя и т.д. // // Corresponds with GET /repos/{owner}/{repo} (the `GetReposOwnerRepo` operationId). GetReposOwnerRepo(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoBranches Получить список веток репозитория // // Возвращает список всех веток репозитория с информацией о последнем коммите и защите веток. // // Corresponds with GET /repos/{owner}/{repo}/branches (the `GetReposOwnerRepoBranches` operationId). GetReposOwnerRepoBranches(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoBranchesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PutReposOwnerRepoCollaboratorsUsernameWithBody Добавить или обновить права пользователя // // Добавляет пользователя как соавтора репозитория или обновляет его уровень доступа. Требуются права администратора текущего репозитория для выполнения операции. // // Takes any type of body and a specified content type. // // Corresponds with PUT /repos/{owner}/{repo}/collaborators/{username} (the `PutReposOwnerRepoCollaboratorsUsername` operationId). PutReposOwnerRepoCollaboratorsUsernameWithBody(ctx context.Context, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PutReposOwnerRepoCollaboratorsUsername Добавить или обновить права пользователя // // Добавляет пользователя как соавтора репозитория или обновляет его уровень доступа. Требуются права администратора текущего репозитория для выполнения операции. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /repos/{owner}/{repo}/collaborators/{username} (the `PutReposOwnerRepoCollaboratorsUsername` operationId). PutReposOwnerRepoCollaboratorsUsername(ctx context.Context, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, body PutReposOwnerRepoCollaboratorsUsernameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoCompareBasehead Сравнить коммиты или ветки // // Сравнивает два коммита, ветки или тега. Параметр basehead в формате base...head. // // Corresponds with GET /repos/{owner}/{repo}/compare/{basehead} (the `GetReposOwnerRepoCompareBasehead` operationId). GetReposOwnerRepoCompareBasehead(ctx context.Context, owner string, repo string, basehead string, params *GetReposOwnerRepoCompareBaseheadParams, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteReposOwnerRepoContentsFilenameWithBody Удалить файл // // Удаляет указанный файл из репозитория. // // Takes any type of body and a specified content type. // // Corresponds with DELETE /repos/{owner}/{repo}/contents/{filename} (the `DeleteReposOwnerRepoContentsFilename` operationId). DeleteReposOwnerRepoContentsFilenameWithBody(ctx context.Context, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteReposOwnerRepoContentsFilename Удалить файл // // Удаляет указанный файл из репозитория. // // Takes a body of the `application/json` content type. // // Corresponds with DELETE /repos/{owner}/{repo}/contents/{filename} (the `DeleteReposOwnerRepoContentsFilename` operationId). DeleteReposOwnerRepoContentsFilename(ctx context.Context, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, body DeleteReposOwnerRepoContentsFilenameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // PutReposOwnerRepoContentsFilenameWithBody Создать или обновить файл // // Создаёт новый файл или обновляет существующий в указанной ветке. // // Takes any type of body and a specified content type. // // Corresponds with PUT /repos/{owner}/{repo}/contents/{filename} (the `PutReposOwnerRepoContentsFilename` operationId). PutReposOwnerRepoContentsFilenameWithBody(ctx context.Context, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PutReposOwnerRepoContentsFilename Создать или обновить файл // // Создаёт новый файл или обновляет существующий в указанной ветке. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /repos/{owner}/{repo}/contents/{filename} (the `PutReposOwnerRepoContentsFilename` operationId). PutReposOwnerRepoContentsFilename(ctx context.Context, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, body PutReposOwnerRepoContentsFilenameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoContentsPath Получить содержимое файла или папки // // Позволяет получить содержимое файла (в Base64) или список файлов внутри папки. // // Corresponds with GET /repos/{owner}/{repo}/contents/{path} (the `GetReposOwnerRepoContentsPath` operationId). GetReposOwnerRepoContentsPath(ctx context.Context, owner string, repo string, path string, params *GetReposOwnerRepoContentsPathParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PostReposOwnerRepoForks Создать форк репозитория // // Создаёт форк репозитория для текущего пользователя. // // Corresponds with POST /repos/{owner}/{repo}/forks (the `PostReposOwnerRepoForks` operationId). PostReposOwnerRepoForks(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoForksParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoGitTreesTreeSha Получить git-дерево // // Возвращает структуру файлов и папок, связанную с указанным деревом Git. // // Corresponds with GET /repos/{owner}/{repo}/git/trees/{tree_sha} (the `GetReposOwnerRepoGitTreesTreeSha` operationId). GetReposOwnerRepoGitTreesTreeSha(ctx context.Context, owner string, repo string, treeSha string, params *GetReposOwnerRepoGitTreesTreeShaParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoIssues Получить список задач (issues) // // Возвращает список задач (issues). На данный момент содержит только запросы на слияние (Pull Requests). Полноценная поддержка задач будет добавлена позже. // // Corresponds with GET /repos/{owner}/{repo}/issues (the `GetReposOwnerRepoIssues` operationId). GetReposOwnerRepoIssues(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoIssuesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoIssuesIndexComments Получить комментарии к задаче или Pull Request // // Возвращает список комментариев для указанной задачи или Pull Request по её номеру. // // Corresponds with GET /repos/{owner}/{repo}/issues/{index}/comments (the `GetReposOwnerRepoIssuesIndexComments` operationId). GetReposOwnerRepoIssuesIndexComments(ctx context.Context, owner string, repo string, index int, params *GetReposOwnerRepoIssuesIndexCommentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoLanguages Получить языки программирования // // Возвращает список языков, используемых в репозитории, с указанием количества строк кода на каждом. // // Corresponds with GET /repos/{owner}/{repo}/languages (the `GetReposOwnerRepoLanguages` operationId). GetReposOwnerRepoLanguages(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoLanguagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoPulls Получить список Pull Request'ов // // Возвращает список Pull Request'ов для указанного репозитория. // // Corresponds with GET /repos/{owner}/{repo}/pulls (the `GetReposOwnerRepoPulls` operationId). GetReposOwnerRepoPulls(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoPullsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PostReposOwnerRepoPullsWithBody Создать Pull Request // // Создаёт новый запрос на слияние из указанной ветки в целевую. // // Takes any type of body and a specified content type. // // Corresponds with POST /repos/{owner}/{repo}/pulls (the `PostReposOwnerRepoPulls` operationId). PostReposOwnerRepoPullsWithBody(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoPullsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PostReposOwnerRepoPulls Создать Pull Request // // Создаёт новый запрос на слияние из указанной ветки в целевую. // // Takes a body of the `application/json` content type. // // Corresponds with POST /repos/{owner}/{repo}/pulls (the `PostReposOwnerRepoPulls` operationId). PostReposOwnerRepoPulls(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoPullsParams, body PostReposOwnerRepoPullsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoPullsPullNumber Получить информацию о Pull Request // // Возвращает детальную информацию о конкретном Pull Request. // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number} (the `GetReposOwnerRepoPullsPullNumber` operationId). GetReposOwnerRepoPullsPullNumber(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchReposOwnerRepoPullsPullNumberWithBody Обновить Pull Request // // Обновляет заголовок, описание или другие поля Pull Request. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /repos/{owner}/{repo}/pulls/{pull_number} (the `PatchReposOwnerRepoPullsPullNumber` operationId). PatchReposOwnerRepoPullsPullNumberWithBody(ctx context.Context, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchReposOwnerRepoPullsPullNumber Обновить Pull Request // // Обновляет заголовок, описание или другие поля Pull Request. // // Takes a body of the `application/json` content type. // // Corresponds with PATCH /repos/{owner}/{repo}/pulls/{pull_number} (the `PatchReposOwnerRepoPullsPullNumber` operationId). PatchReposOwnerRepoPullsPullNumber(ctx context.Context, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, body PatchReposOwnerRepoPullsPullNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoPullsPullNumberFiles Получить файлы Pull Request // // Возвращает список файлов, изменённых в Pull Request. // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number}/files (the `GetReposOwnerRepoPullsPullNumberFiles` operationId). GetReposOwnerRepoPullsPullNumberFiles(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetReposOwnerRepoPullsPullNumberMerge Проверить статус merge Pull Request // // Проверяет, может ли Pull Request быть слит. Не выполняет merge. // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number}/merge (the `GetReposOwnerRepoPullsPullNumberMerge` operationId). GetReposOwnerRepoPullsPullNumberMerge(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberMergeParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetUser Получить данные аутентифицированного пользователя // // Возвращает информацию о текущем аутентифицированном пользователе. // // Corresponds with GET /user (the `GetUser` operationId). GetUser(ctx context.Context, params *GetUserParams, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteUserEmailsWithBody Удалить email-адреса // // Удаляет указанные email-адреса. // // Takes any type of body and a specified content type. // // Corresponds with DELETE /user/emails (the `DeleteUserEmails` operationId). DeleteUserEmailsWithBody(ctx context.Context, params *DeleteUserEmailsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteUserEmails Удалить email-адреса // // Удаляет указанные email-адреса. // // Takes a body of the `application/json` content type. // // Corresponds with DELETE /user/emails (the `DeleteUserEmails` operationId). DeleteUserEmails(ctx context.Context, params *DeleteUserEmailsParams, body DeleteUserEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetUserEmails Получить список email-адресов // // Возвращает список email-адресов текущего пользователя. // // Corresponds with GET /user/emails (the `GetUserEmails` operationId). GetUserEmails(ctx context.Context, params *GetUserEmailsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PostUserEmailsWithBody Добавить email-адреса // // Добавляет один или несколько новых email-адресов текущему пользователю. // // Takes any type of body and a specified content type. // // Corresponds with POST /user/emails (the `PostUserEmails` operationId). PostUserEmailsWithBody(ctx context.Context, params *PostUserEmailsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PostUserEmails Добавить email-адреса // // Добавляет один или несколько новых email-адресов текущему пользователю. // // Takes a body of the `application/json` content type. // // Corresponds with POST /user/emails (the `PostUserEmails` operationId). PostUserEmails(ctx context.Context, params *PostUserEmailsParams, body PostUserEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetUserRepos Получить список репозиториев пользователя // // Возвращает все репозитории, доступные пользователю (личные и организации). // // Corresponds with GET /user/repos (the `GetUserRepos` operationId). GetUserRepos(ctx context.Context, params *GetUserReposParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PostUserReposWithBody Создать новый репозиторий // // Создаёт новый репозиторий для пользователя. // // Takes any type of body and a specified content type. // // Corresponds with POST /user/repos (the `PostUserRepos` operationId). PostUserReposWithBody(ctx context.Context, params *PostUserReposParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PostUserRepos Создать новый репозиторий // // Создаёт новый репозиторий для пользователя. // // Takes a body of the `application/json` content type. // // Corresponds with POST /user/repos (the `PostUserRepos` operationId). PostUserRepos(ctx context.Context, params *PostUserReposParams, body PostUserReposJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetUserStarredOwnerRepo Проверить наличие звезды у репозитория // // Позволяет проверить, добавлен ли указанный репозиторий в список отслеживаемых у текущего пользователя. // // Corresponds with GET /user/starred/{owner}/{repo} (the `GetUserStarredOwnerRepo` operationId). GetUserStarredOwnerRepo(ctx context.Context, owner string, repo string, params *GetUserStarredOwnerRepoParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PutUserStarredOwnerRepo Добавить звезду репозиторию // // Добавляет указанный репозиторий в список отслеживаемых пользователем («ставит звезду»). // // Corresponds with PUT /user/starred/{owner}/{repo} (the `PutUserStarredOwnerRepo` operationId). PutUserStarredOwnerRepo(ctx context.Context, owner string, repo string, params *PutUserStarredOwnerRepoParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetUsersUsername Получить данные пользователя по логину // // Позволяет получить информацию о любом пользователе по его логину. // // Corresponds with GET /users/{username} (the `GetUsersUsername` operationId). GetUsersUsername(ctx context.Context, username string, params *GetUsersUsernameParams, reqEditors ...RequestEditorFn) (*http.Response, error) } // GetReposOwnerRepo Получить информацию о репозитории // // Возвращает основные данные о репозитории: название, владельца, настройки, права пользователя и т.д. // // Corresponds with GET /repos/{owner}/{repo} (the `GetReposOwnerRepo` operationId). func (c *Client) GetReposOwnerRepo(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoRequest(c.Server, owner, repo, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoBranches Получить список веток репозитория // // Возвращает список всех веток репозитория с информацией о последнем коммите и защите веток. // // Corresponds with GET /repos/{owner}/{repo}/branches (the `GetReposOwnerRepoBranches` operationId). func (c *Client) GetReposOwnerRepoBranches(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoBranchesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoBranchesRequest(c.Server, owner, repo, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutReposOwnerRepoCollaboratorsUsernameWithBody Добавить или обновить права пользователя // // Добавляет пользователя как соавтора репозитория или обновляет его уровень доступа. Требуются права администратора текущего репозитория для выполнения операции. // // Takes any type of body and a specified content type. // // Corresponds with PUT /repos/{owner}/{repo}/collaborators/{username} (the `PutReposOwnerRepoCollaboratorsUsername` operationId). func (c *Client) PutReposOwnerRepoCollaboratorsUsernameWithBody(ctx context.Context, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutReposOwnerRepoCollaboratorsUsernameRequestWithBody(c.Server, owner, repo, username, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutReposOwnerRepoCollaboratorsUsername Добавить или обновить права пользователя // // Добавляет пользователя как соавтора репозитория или обновляет его уровень доступа. Требуются права администратора текущего репозитория для выполнения операции. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /repos/{owner}/{repo}/collaborators/{username} (the `PutReposOwnerRepoCollaboratorsUsername` operationId). func (c *Client) PutReposOwnerRepoCollaboratorsUsername(ctx context.Context, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, body PutReposOwnerRepoCollaboratorsUsernameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutReposOwnerRepoCollaboratorsUsernameRequest(c.Server, owner, repo, username, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoCompareBasehead Сравнить коммиты или ветки // // Сравнивает два коммита, ветки или тега. Параметр basehead в формате base...head. // // Corresponds with GET /repos/{owner}/{repo}/compare/{basehead} (the `GetReposOwnerRepoCompareBasehead` operationId). func (c *Client) GetReposOwnerRepoCompareBasehead(ctx context.Context, owner string, repo string, basehead string, params *GetReposOwnerRepoCompareBaseheadParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoCompareBaseheadRequest(c.Server, owner, repo, basehead, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteReposOwnerRepoContentsFilenameWithBody Удалить файл // // Удаляет указанный файл из репозитория. // // Takes any type of body and a specified content type. // // Corresponds with DELETE /repos/{owner}/{repo}/contents/{filename} (the `DeleteReposOwnerRepoContentsFilename` operationId). func (c *Client) DeleteReposOwnerRepoContentsFilenameWithBody(ctx context.Context, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteReposOwnerRepoContentsFilenameRequestWithBody(c.Server, owner, repo, filename, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteReposOwnerRepoContentsFilename Удалить файл // // Удаляет указанный файл из репозитория. // // Takes a body of the `application/json` content type. // // Corresponds with DELETE /repos/{owner}/{repo}/contents/{filename} (the `DeleteReposOwnerRepoContentsFilename` operationId). func (c *Client) DeleteReposOwnerRepoContentsFilename(ctx context.Context, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, body DeleteReposOwnerRepoContentsFilenameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteReposOwnerRepoContentsFilenameRequest(c.Server, owner, repo, filename, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutReposOwnerRepoContentsFilenameWithBody Создать или обновить файл // // Создаёт новый файл или обновляет существующий в указанной ветке. // // Takes any type of body and a specified content type. // // Corresponds with PUT /repos/{owner}/{repo}/contents/{filename} (the `PutReposOwnerRepoContentsFilename` operationId). func (c *Client) PutReposOwnerRepoContentsFilenameWithBody(ctx context.Context, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutReposOwnerRepoContentsFilenameRequestWithBody(c.Server, owner, repo, filename, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutReposOwnerRepoContentsFilename Создать или обновить файл // // Создаёт новый файл или обновляет существующий в указанной ветке. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /repos/{owner}/{repo}/contents/{filename} (the `PutReposOwnerRepoContentsFilename` operationId). func (c *Client) PutReposOwnerRepoContentsFilename(ctx context.Context, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, body PutReposOwnerRepoContentsFilenameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutReposOwnerRepoContentsFilenameRequest(c.Server, owner, repo, filename, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoContentsPath Получить содержимое файла или папки // // Позволяет получить содержимое файла (в Base64) или список файлов внутри папки. // // Corresponds with GET /repos/{owner}/{repo}/contents/{path} (the `GetReposOwnerRepoContentsPath` operationId). func (c *Client) GetReposOwnerRepoContentsPath(ctx context.Context, owner string, repo string, path string, params *GetReposOwnerRepoContentsPathParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoContentsPathRequest(c.Server, owner, repo, path, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PostReposOwnerRepoForks Создать форк репозитория // // Создаёт форк репозитория для текущего пользователя. // // Corresponds with POST /repos/{owner}/{repo}/forks (the `PostReposOwnerRepoForks` operationId). func (c *Client) PostReposOwnerRepoForks(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoForksParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostReposOwnerRepoForksRequest(c.Server, owner, repo, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoGitTreesTreeSha Получить git-дерево // // Возвращает структуру файлов и папок, связанную с указанным деревом Git. // // Corresponds with GET /repos/{owner}/{repo}/git/trees/{tree_sha} (the `GetReposOwnerRepoGitTreesTreeSha` operationId). func (c *Client) GetReposOwnerRepoGitTreesTreeSha(ctx context.Context, owner string, repo string, treeSha string, params *GetReposOwnerRepoGitTreesTreeShaParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoGitTreesTreeShaRequest(c.Server, owner, repo, treeSha, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoIssues Получить список задач (issues) // // Возвращает список задач (issues). На данный момент содержит только запросы на слияние (Pull Requests). Полноценная поддержка задач будет добавлена позже. // // Corresponds with GET /repos/{owner}/{repo}/issues (the `GetReposOwnerRepoIssues` operationId). func (c *Client) GetReposOwnerRepoIssues(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoIssuesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoIssuesRequest(c.Server, owner, repo, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoIssuesIndexComments Получить комментарии к задаче или Pull Request // // Возвращает список комментариев для указанной задачи или Pull Request по её номеру. // // Corresponds with GET /repos/{owner}/{repo}/issues/{index}/comments (the `GetReposOwnerRepoIssuesIndexComments` operationId). func (c *Client) GetReposOwnerRepoIssuesIndexComments(ctx context.Context, owner string, repo string, index int, params *GetReposOwnerRepoIssuesIndexCommentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoIssuesIndexCommentsRequest(c.Server, owner, repo, index, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoLanguages Получить языки программирования // // Возвращает список языков, используемых в репозитории, с указанием количества строк кода на каждом. // // Corresponds with GET /repos/{owner}/{repo}/languages (the `GetReposOwnerRepoLanguages` operationId). func (c *Client) GetReposOwnerRepoLanguages(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoLanguagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoLanguagesRequest(c.Server, owner, repo, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoPulls Получить список Pull Request'ов // // Возвращает список Pull Request'ов для указанного репозитория. // // Corresponds with GET /repos/{owner}/{repo}/pulls (the `GetReposOwnerRepoPulls` operationId). func (c *Client) GetReposOwnerRepoPulls(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoPullsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoPullsRequest(c.Server, owner, repo, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PostReposOwnerRepoPullsWithBody Создать Pull Request // // Создаёт новый запрос на слияние из указанной ветки в целевую. // // Takes any type of body and a specified content type. // // Corresponds with POST /repos/{owner}/{repo}/pulls (the `PostReposOwnerRepoPulls` operationId). func (c *Client) PostReposOwnerRepoPullsWithBody(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoPullsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostReposOwnerRepoPullsRequestWithBody(c.Server, owner, repo, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PostReposOwnerRepoPulls Создать Pull Request // // Создаёт новый запрос на слияние из указанной ветки в целевую. // // Takes a body of the `application/json` content type. // // Corresponds with POST /repos/{owner}/{repo}/pulls (the `PostReposOwnerRepoPulls` operationId). func (c *Client) PostReposOwnerRepoPulls(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoPullsParams, body PostReposOwnerRepoPullsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostReposOwnerRepoPullsRequest(c.Server, owner, repo, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoPullsPullNumber Получить информацию о Pull Request // // Возвращает детальную информацию о конкретном Pull Request. // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number} (the `GetReposOwnerRepoPullsPullNumber` operationId). func (c *Client) GetReposOwnerRepoPullsPullNumber(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoPullsPullNumberRequest(c.Server, owner, repo, pullNumber, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchReposOwnerRepoPullsPullNumberWithBody Обновить Pull Request // // Обновляет заголовок, описание или другие поля Pull Request. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /repos/{owner}/{repo}/pulls/{pull_number} (the `PatchReposOwnerRepoPullsPullNumber` operationId). func (c *Client) PatchReposOwnerRepoPullsPullNumberWithBody(ctx context.Context, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchReposOwnerRepoPullsPullNumberRequestWithBody(c.Server, owner, repo, pullNumber, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchReposOwnerRepoPullsPullNumber Обновить Pull Request // // Обновляет заголовок, описание или другие поля Pull Request. // // Takes a body of the `application/json` content type. // // Corresponds with PATCH /repos/{owner}/{repo}/pulls/{pull_number} (the `PatchReposOwnerRepoPullsPullNumber` operationId). func (c *Client) PatchReposOwnerRepoPullsPullNumber(ctx context.Context, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, body PatchReposOwnerRepoPullsPullNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchReposOwnerRepoPullsPullNumberRequest(c.Server, owner, repo, pullNumber, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoPullsPullNumberFiles Получить файлы Pull Request // // Возвращает список файлов, изменённых в Pull Request. // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number}/files (the `GetReposOwnerRepoPullsPullNumberFiles` operationId). func (c *Client) GetReposOwnerRepoPullsPullNumberFiles(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoPullsPullNumberFilesRequest(c.Server, owner, repo, pullNumber, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetReposOwnerRepoPullsPullNumberMerge Проверить статус merge Pull Request // // Проверяет, может ли Pull Request быть слит. Не выполняет merge. // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number}/merge (the `GetReposOwnerRepoPullsPullNumberMerge` operationId). func (c *Client) GetReposOwnerRepoPullsPullNumberMerge(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberMergeParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetReposOwnerRepoPullsPullNumberMergeRequest(c.Server, owner, repo, pullNumber, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetUser Получить данные аутентифицированного пользователя // // Возвращает информацию о текущем аутентифицированном пользователе. // // Corresponds with GET /user (the `GetUser` operationId). func (c *Client) GetUser(ctx context.Context, params *GetUserParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetUserRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteUserEmailsWithBody Удалить email-адреса // // Удаляет указанные email-адреса. // // Takes any type of body and a specified content type. // // Corresponds with DELETE /user/emails (the `DeleteUserEmails` operationId). func (c *Client) DeleteUserEmailsWithBody(ctx context.Context, params *DeleteUserEmailsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteUserEmailsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteUserEmails Удалить email-адреса // // Удаляет указанные email-адреса. // // Takes a body of the `application/json` content type. // // Corresponds with DELETE /user/emails (the `DeleteUserEmails` operationId). func (c *Client) DeleteUserEmails(ctx context.Context, params *DeleteUserEmailsParams, body DeleteUserEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteUserEmailsRequest(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetUserEmails Получить список email-адресов // // Возвращает список email-адресов текущего пользователя. // // Corresponds with GET /user/emails (the `GetUserEmails` operationId). func (c *Client) GetUserEmails(ctx context.Context, params *GetUserEmailsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetUserEmailsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PostUserEmailsWithBody Добавить email-адреса // // Добавляет один или несколько новых email-адресов текущему пользователю. // // Takes any type of body and a specified content type. // // Corresponds with POST /user/emails (the `PostUserEmails` operationId). func (c *Client) PostUserEmailsWithBody(ctx context.Context, params *PostUserEmailsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostUserEmailsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PostUserEmails Добавить email-адреса // // Добавляет один или несколько новых email-адресов текущему пользователю. // // Takes a body of the `application/json` content type. // // Corresponds with POST /user/emails (the `PostUserEmails` operationId). func (c *Client) PostUserEmails(ctx context.Context, params *PostUserEmailsParams, body PostUserEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostUserEmailsRequest(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetUserRepos Получить список репозиториев пользователя // // Возвращает все репозитории, доступные пользователю (личные и организации). // // Corresponds with GET /user/repos (the `GetUserRepos` operationId). func (c *Client) GetUserRepos(ctx context.Context, params *GetUserReposParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetUserReposRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PostUserReposWithBody Создать новый репозиторий // // Создаёт новый репозиторий для пользователя. // // Takes any type of body and a specified content type. // // Corresponds with POST /user/repos (the `PostUserRepos` operationId). func (c *Client) PostUserReposWithBody(ctx context.Context, params *PostUserReposParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostUserReposRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PostUserRepos Создать новый репозиторий // // Создаёт новый репозиторий для пользователя. // // Takes a body of the `application/json` content type. // // Corresponds with POST /user/repos (the `PostUserRepos` operationId). func (c *Client) PostUserRepos(ctx context.Context, params *PostUserReposParams, body PostUserReposJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostUserReposRequest(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetUserStarredOwnerRepo Проверить наличие звезды у репозитория // // Позволяет проверить, добавлен ли указанный репозиторий в список отслеживаемых у текущего пользователя. // // Corresponds with GET /user/starred/{owner}/{repo} (the `GetUserStarredOwnerRepo` operationId). func (c *Client) GetUserStarredOwnerRepo(ctx context.Context, owner string, repo string, params *GetUserStarredOwnerRepoParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetUserStarredOwnerRepoRequest(c.Server, owner, repo, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutUserStarredOwnerRepo Добавить звезду репозиторию // // Добавляет указанный репозиторий в список отслеживаемых пользователем («ставит звезду»). // // Corresponds with PUT /user/starred/{owner}/{repo} (the `PutUserStarredOwnerRepo` operationId). func (c *Client) PutUserStarredOwnerRepo(ctx context.Context, owner string, repo string, params *PutUserStarredOwnerRepoParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutUserStarredOwnerRepoRequest(c.Server, owner, repo, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetUsersUsername Получить данные пользователя по логину // // Позволяет получить информацию о любом пользователе по его логину. // // Corresponds with GET /users/{username} (the `GetUsersUsername` operationId). func (c *Client) GetUsersUsername(ctx context.Context, username string, params *GetUsersUsernameParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetUsersUsernameRequest(c.Server, username, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // NewGetReposOwnerRepoRequest constructs an http.Request for the GetReposOwnerRepo method func NewGetReposOwnerRepoRequest(server string, owner string, repo string, params *GetReposOwnerRepoParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoBranchesRequest constructs an http.Request for the GetReposOwnerRepoBranches method func NewGetReposOwnerRepoBranchesRequest(server string, owner string, repo string, params *GetReposOwnerRepoBranchesParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/branches", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewPutReposOwnerRepoCollaboratorsUsernameRequest calls the generic PutReposOwnerRepoCollaboratorsUsername builder with application/json body func NewPutReposOwnerRepoCollaboratorsUsernameRequest(server string, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, body PutReposOwnerRepoCollaboratorsUsernameJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPutReposOwnerRepoCollaboratorsUsernameRequestWithBody(server, owner, repo, username, params, "application/json", bodyReader) } // NewPutReposOwnerRepoCollaboratorsUsernameRequestWithBody constructs an http.Request for the PutReposOwnerRepoCollaboratorsUsername method, with any body, and a specified content type func NewPutReposOwnerRepoCollaboratorsUsernameRequestWithBody(server string, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "username", username, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/collaborators/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoCompareBaseheadRequest constructs an http.Request for the GetReposOwnerRepoCompareBasehead method func NewGetReposOwnerRepoCompareBaseheadRequest(server string, owner string, repo string, basehead string, params *GetReposOwnerRepoCompareBaseheadParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "basehead", basehead, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/compare/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewDeleteReposOwnerRepoContentsFilenameRequest calls the generic DeleteReposOwnerRepoContentsFilename builder with application/json body func NewDeleteReposOwnerRepoContentsFilenameRequest(server string, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, body DeleteReposOwnerRepoContentsFilenameJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewDeleteReposOwnerRepoContentsFilenameRequestWithBody(server, owner, repo, filename, params, "application/json", bodyReader) } // NewDeleteReposOwnerRepoContentsFilenameRequestWithBody constructs an http.Request for the DeleteReposOwnerRepoContentsFilename method, with any body, and a specified content type func NewDeleteReposOwnerRepoContentsFilenameRequestWithBody(server string, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "filename", filename, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/contents/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewPutReposOwnerRepoContentsFilenameRequest calls the generic PutReposOwnerRepoContentsFilename builder with application/json body func NewPutReposOwnerRepoContentsFilenameRequest(server string, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, body PutReposOwnerRepoContentsFilenameJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPutReposOwnerRepoContentsFilenameRequestWithBody(server, owner, repo, filename, params, "application/json", bodyReader) } // NewPutReposOwnerRepoContentsFilenameRequestWithBody constructs an http.Request for the PutReposOwnerRepoContentsFilename method, with any body, and a specified content type func NewPutReposOwnerRepoContentsFilenameRequestWithBody(server string, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "filename", filename, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/contents/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoContentsPathRequest constructs an http.Request for the GetReposOwnerRepoContentsPath method func NewGetReposOwnerRepoContentsPathRequest(server string, owner string, repo string, path string, params *GetReposOwnerRepoContentsPathParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "path", path, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/contents/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewPostReposOwnerRepoForksRequest constructs an http.Request for the PostReposOwnerRepoForks method func NewPostReposOwnerRepoForksRequest(server string, owner string, repo string, params *PostReposOwnerRepoForksParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/forks", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoGitTreesTreeShaRequest constructs an http.Request for the GetReposOwnerRepoGitTreesTreeSha method func NewGetReposOwnerRepoGitTreesTreeShaRequest(server string, owner string, repo string, treeSha string, params *GetReposOwnerRepoGitTreesTreeShaParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "tree_sha", treeSha, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/git/trees/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Recursive != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "recursive", *params.Recursive, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoIssuesRequest constructs an http.Request for the GetReposOwnerRepoIssues method func NewGetReposOwnerRepoIssuesRequest(server string, owner string, repo string, params *GetReposOwnerRepoIssuesParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/issues", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoIssuesIndexCommentsRequest constructs an http.Request for the GetReposOwnerRepoIssuesIndexComments method func NewGetReposOwnerRepoIssuesIndexCommentsRequest(server string, owner string, repo string, index int, params *GetReposOwnerRepoIssuesIndexCommentsParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "index", index, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/issues/%s/comments", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Page != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "per_page", *params.PerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoLanguagesRequest constructs an http.Request for the GetReposOwnerRepoLanguages method func NewGetReposOwnerRepoLanguagesRequest(server string, owner string, repo string, params *GetReposOwnerRepoLanguagesParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/languages", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoPullsRequest constructs an http.Request for the GetReposOwnerRepoPulls method func NewGetReposOwnerRepoPullsRequest(server string, owner string, repo string, params *GetReposOwnerRepoPullsParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/pulls", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.State != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "state", *params.State, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Page != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "per_page", *params.PerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewPostReposOwnerRepoPullsRequest calls the generic PostReposOwnerRepoPulls builder with application/json body func NewPostReposOwnerRepoPullsRequest(server string, owner string, repo string, params *PostReposOwnerRepoPullsParams, body PostReposOwnerRepoPullsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPostReposOwnerRepoPullsRequestWithBody(server, owner, repo, params, "application/json", bodyReader) } // NewPostReposOwnerRepoPullsRequestWithBody constructs an http.Request for the PostReposOwnerRepoPulls method, with any body, and a specified content type func NewPostReposOwnerRepoPullsRequestWithBody(server string, owner string, repo string, params *PostReposOwnerRepoPullsParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/pulls", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoPullsPullNumberRequest constructs an http.Request for the GetReposOwnerRepoPullsPullNumber method func NewGetReposOwnerRepoPullsPullNumberRequest(server string, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "pull_number", pullNumber, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/pulls/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewPatchReposOwnerRepoPullsPullNumberRequest calls the generic PatchReposOwnerRepoPullsPullNumber builder with application/json body func NewPatchReposOwnerRepoPullsPullNumberRequest(server string, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, body PatchReposOwnerRepoPullsPullNumberJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchReposOwnerRepoPullsPullNumberRequestWithBody(server, owner, repo, pullNumber, params, "application/json", bodyReader) } // NewPatchReposOwnerRepoPullsPullNumberRequestWithBody constructs an http.Request for the PatchReposOwnerRepoPullsPullNumber method, with any body, and a specified content type func NewPatchReposOwnerRepoPullsPullNumberRequestWithBody(server string, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "pull_number", pullNumber, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/pulls/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoPullsPullNumberFilesRequest constructs an http.Request for the GetReposOwnerRepoPullsPullNumberFiles method func NewGetReposOwnerRepoPullsPullNumberFilesRequest(server string, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberFilesParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "pull_number", pullNumber, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/pulls/%s/files", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Page != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.PerPage != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "per_page", *params.PerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetReposOwnerRepoPullsPullNumberMergeRequest constructs an http.Request for the GetReposOwnerRepoPullsPullNumberMerge method func NewGetReposOwnerRepoPullsPullNumberMergeRequest(server string, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberMergeParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "pull_number", pullNumber, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/repos/%s/%s/pulls/%s/merge", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetUserRequest constructs an http.Request for the GetUser method func NewGetUserRequest(server string, params *GetUserParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/user") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewDeleteUserEmailsRequest calls the generic DeleteUserEmails builder with application/json body func NewDeleteUserEmailsRequest(server string, params *DeleteUserEmailsParams, body DeleteUserEmailsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewDeleteUserEmailsRequestWithBody(server, params, "application/json", bodyReader) } // NewDeleteUserEmailsRequestWithBody constructs an http.Request for the DeleteUserEmails method, with any body, and a specified content type func NewDeleteUserEmailsRequestWithBody(server string, params *DeleteUserEmailsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/user/emails") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetUserEmailsRequest constructs an http.Request for the GetUserEmails method func NewGetUserEmailsRequest(server string, params *GetUserEmailsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/user/emails") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewPostUserEmailsRequest calls the generic PostUserEmails builder with application/json body func NewPostUserEmailsRequest(server string, params *PostUserEmailsParams, body PostUserEmailsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPostUserEmailsRequestWithBody(server, params, "application/json", bodyReader) } // NewPostUserEmailsRequestWithBody constructs an http.Request for the PostUserEmails method, with any body, and a specified content type func NewPostUserEmailsRequestWithBody(server string, params *PostUserEmailsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/user/emails") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetUserReposRequest constructs an http.Request for the GetUserRepos method func NewGetUserReposRequest(server string, params *GetUserReposParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/user/repos") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewPostUserReposRequest calls the generic PostUserRepos builder with application/json body func NewPostUserReposRequest(server string, params *PostUserReposParams, body PostUserReposJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPostUserReposRequestWithBody(server, params, "application/json", bodyReader) } // NewPostUserReposRequestWithBody constructs an http.Request for the PostUserRepos method, with any body, and a specified content type func NewPostUserReposRequestWithBody(server string, params *PostUserReposParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/user/repos") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetUserStarredOwnerRepoRequest constructs an http.Request for the GetUserStarredOwnerRepo method func NewGetUserStarredOwnerRepoRequest(server string, owner string, repo string, params *GetUserStarredOwnerRepoParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/user/starred/%s/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewPutUserStarredOwnerRepoRequest constructs an http.Request for the PutUserStarredOwnerRepo method func NewPutUserStarredOwnerRepoRequest(server string, owner string, repo string, params *PutUserStarredOwnerRepoParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "owner", owner, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "repo", repo, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/user/starred/%s/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } // NewGetUsersUsernameRequest constructs an http.Request for the GetUsersUsername method func NewGetUsersUsernameRequest(server string, username string, params *GetUsersUsernameParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "username", username, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/users/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "Accept", params.Accept, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("Accept", headerParam0) } return req, nil } func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { for _, r := range c.RequestEditors { if err := r(ctx, req); err != nil { return err } } for _, r := range additionalEditors { if err := r(ctx, req); err != nil { return err } } return nil } // ClientWithResponses builds on ClientInterface to offer response payloads type ClientWithResponses struct { ClientInterface } // NewClientWithResponses creates a new ClientWithResponses, which wraps // Client with return type handling func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { client, err := NewClient(server, opts...) if err != nil { return nil, err } return &ClientWithResponses{client}, nil } // WithBaseURL overrides the baseURL. func WithBaseURL(baseURL string) ClientOption { return func(c *Client) error { newBaseURL, err := url.Parse(baseURL) if err != nil { return err } c.Server = newBaseURL.String() return nil } } // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { // GetReposOwnerRepoWithResponse Получить информацию о репозитории // // Возвращает основные данные о репозитории: название, владельца, настройки, права пользователя и т.д. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo} (the `GetReposOwnerRepo` operationId). GetReposOwnerRepoWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoResponse, error) // GetReposOwnerRepoBranchesWithResponse Получить список веток репозитория // // Возвращает список всех веток репозитория с информацией о последнем коммите и защите веток. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/branches (the `GetReposOwnerRepoBranches` operationId). GetReposOwnerRepoBranchesWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoBranchesParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoBranchesResponse, error) // PutReposOwnerRepoCollaboratorsUsernameWithBodyWithResponse Добавить или обновить права пользователя // // Добавляет пользователя как соавтора репозитория или обновляет его уровень доступа. Требуются права администратора текущего репозитория для выполнения операции. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /repos/{owner}/{repo}/collaborators/{username} (the `PutReposOwnerRepoCollaboratorsUsername` operationId). PutReposOwnerRepoCollaboratorsUsernameWithBodyWithResponse(ctx context.Context, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutReposOwnerRepoCollaboratorsUsernameResponse, error) // PutReposOwnerRepoCollaboratorsUsernameWithResponse Добавить или обновить права пользователя // // Добавляет пользователя как соавтора репозитория или обновляет его уровень доступа. Требуются права администратора текущего репозитория для выполнения операции. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /repos/{owner}/{repo}/collaborators/{username} (the `PutReposOwnerRepoCollaboratorsUsername` operationId). PutReposOwnerRepoCollaboratorsUsernameWithResponse(ctx context.Context, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, body PutReposOwnerRepoCollaboratorsUsernameJSONRequestBody, reqEditors ...RequestEditorFn) (*PutReposOwnerRepoCollaboratorsUsernameResponse, error) // GetReposOwnerRepoCompareBaseheadWithResponse Сравнить коммиты или ветки // // Сравнивает два коммита, ветки или тега. Параметр basehead в формате base...head. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/compare/{basehead} (the `GetReposOwnerRepoCompareBasehead` operationId). GetReposOwnerRepoCompareBaseheadWithResponse(ctx context.Context, owner string, repo string, basehead string, params *GetReposOwnerRepoCompareBaseheadParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoCompareBaseheadResponse, error) // DeleteReposOwnerRepoContentsFilenameWithBodyWithResponse Удалить файл // // Удаляет указанный файл из репозитория. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /repos/{owner}/{repo}/contents/{filename} (the `DeleteReposOwnerRepoContentsFilename` operationId). DeleteReposOwnerRepoContentsFilenameWithBodyWithResponse(ctx context.Context, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteReposOwnerRepoContentsFilenameResponse, error) // DeleteReposOwnerRepoContentsFilenameWithResponse Удалить файл // // Удаляет указанный файл из репозитория. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /repos/{owner}/{repo}/contents/{filename} (the `DeleteReposOwnerRepoContentsFilename` operationId). DeleteReposOwnerRepoContentsFilenameWithResponse(ctx context.Context, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, body DeleteReposOwnerRepoContentsFilenameJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteReposOwnerRepoContentsFilenameResponse, error) // PutReposOwnerRepoContentsFilenameWithBodyWithResponse Создать или обновить файл // // Создаёт новый файл или обновляет существующий в указанной ветке. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /repos/{owner}/{repo}/contents/{filename} (the `PutReposOwnerRepoContentsFilename` operationId). PutReposOwnerRepoContentsFilenameWithBodyWithResponse(ctx context.Context, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutReposOwnerRepoContentsFilenameResponse, error) // PutReposOwnerRepoContentsFilenameWithResponse Создать или обновить файл // // Создаёт новый файл или обновляет существующий в указанной ветке. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /repos/{owner}/{repo}/contents/{filename} (the `PutReposOwnerRepoContentsFilename` operationId). PutReposOwnerRepoContentsFilenameWithResponse(ctx context.Context, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, body PutReposOwnerRepoContentsFilenameJSONRequestBody, reqEditors ...RequestEditorFn) (*PutReposOwnerRepoContentsFilenameResponse, error) // GetReposOwnerRepoContentsPathWithResponse Получить содержимое файла или папки // // Позволяет получить содержимое файла (в Base64) или список файлов внутри папки. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/contents/{path} (the `GetReposOwnerRepoContentsPath` operationId). GetReposOwnerRepoContentsPathWithResponse(ctx context.Context, owner string, repo string, path string, params *GetReposOwnerRepoContentsPathParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoContentsPathResponse, error) // PostReposOwnerRepoForksWithResponse Создать форк репозитория // // Создаёт форк репозитория для текущего пользователя. // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /repos/{owner}/{repo}/forks (the `PostReposOwnerRepoForks` operationId). PostReposOwnerRepoForksWithResponse(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoForksParams, reqEditors ...RequestEditorFn) (*PostReposOwnerRepoForksResponse, error) // GetReposOwnerRepoGitTreesTreeShaWithResponse Получить git-дерево // // Возвращает структуру файлов и папок, связанную с указанным деревом Git. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/git/trees/{tree_sha} (the `GetReposOwnerRepoGitTreesTreeSha` operationId). GetReposOwnerRepoGitTreesTreeShaWithResponse(ctx context.Context, owner string, repo string, treeSha string, params *GetReposOwnerRepoGitTreesTreeShaParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoGitTreesTreeShaResponse, error) // GetReposOwnerRepoIssuesWithResponse Получить список задач (issues) // // Возвращает список задач (issues). На данный момент содержит только запросы на слияние (Pull Requests). Полноценная поддержка задач будет добавлена позже. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/issues (the `GetReposOwnerRepoIssues` operationId). GetReposOwnerRepoIssuesWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoIssuesParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoIssuesResponse, error) // GetReposOwnerRepoIssuesIndexCommentsWithResponse Получить комментарии к задаче или Pull Request // // Возвращает список комментариев для указанной задачи или Pull Request по её номеру. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/issues/{index}/comments (the `GetReposOwnerRepoIssuesIndexComments` operationId). GetReposOwnerRepoIssuesIndexCommentsWithResponse(ctx context.Context, owner string, repo string, index int, params *GetReposOwnerRepoIssuesIndexCommentsParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoIssuesIndexCommentsResponse, error) // GetReposOwnerRepoLanguagesWithResponse Получить языки программирования // // Возвращает список языков, используемых в репозитории, с указанием количества строк кода на каждом. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/languages (the `GetReposOwnerRepoLanguages` operationId). GetReposOwnerRepoLanguagesWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoLanguagesParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoLanguagesResponse, error) // GetReposOwnerRepoPullsWithResponse Получить список Pull Request'ов // // Возвращает список Pull Request'ов для указанного репозитория. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/pulls (the `GetReposOwnerRepoPulls` operationId). GetReposOwnerRepoPullsWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoPullsParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoPullsResponse, error) // PostReposOwnerRepoPullsWithBodyWithResponse Создать Pull Request // // Создаёт новый запрос на слияние из указанной ветки в целевую. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /repos/{owner}/{repo}/pulls (the `PostReposOwnerRepoPulls` operationId). PostReposOwnerRepoPullsWithBodyWithResponse(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoPullsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostReposOwnerRepoPullsResponse, error) // PostReposOwnerRepoPullsWithResponse Создать Pull Request // // Создаёт новый запрос на слияние из указанной ветки в целевую. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /repos/{owner}/{repo}/pulls (the `PostReposOwnerRepoPulls` operationId). PostReposOwnerRepoPullsWithResponse(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoPullsParams, body PostReposOwnerRepoPullsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostReposOwnerRepoPullsResponse, error) // GetReposOwnerRepoPullsPullNumberWithResponse Получить информацию о Pull Request // // Возвращает детальную информацию о конкретном Pull Request. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number} (the `GetReposOwnerRepoPullsPullNumber` operationId). GetReposOwnerRepoPullsPullNumberWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoPullsPullNumberResponse, error) // PatchReposOwnerRepoPullsPullNumberWithBodyWithResponse Обновить Pull Request // // Обновляет заголовок, описание или другие поля Pull Request. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PATCH /repos/{owner}/{repo}/pulls/{pull_number} (the `PatchReposOwnerRepoPullsPullNumber` operationId). PatchReposOwnerRepoPullsPullNumberWithBodyWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchReposOwnerRepoPullsPullNumberResponse, error) // PatchReposOwnerRepoPullsPullNumberWithResponse Обновить Pull Request // // Обновляет заголовок, описание или другие поля Pull Request. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PATCH /repos/{owner}/{repo}/pulls/{pull_number} (the `PatchReposOwnerRepoPullsPullNumber` operationId). PatchReposOwnerRepoPullsPullNumberWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, body PatchReposOwnerRepoPullsPullNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchReposOwnerRepoPullsPullNumberResponse, error) // GetReposOwnerRepoPullsPullNumberFilesWithResponse Получить файлы Pull Request // // Возвращает список файлов, изменённых в Pull Request. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number}/files (the `GetReposOwnerRepoPullsPullNumberFiles` operationId). GetReposOwnerRepoPullsPullNumberFilesWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberFilesParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoPullsPullNumberFilesResponse, error) // GetReposOwnerRepoPullsPullNumberMergeWithResponse Проверить статус merge Pull Request // // Проверяет, может ли Pull Request быть слит. Не выполняет merge. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number}/merge (the `GetReposOwnerRepoPullsPullNumberMerge` operationId). GetReposOwnerRepoPullsPullNumberMergeWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberMergeParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoPullsPullNumberMergeResponse, error) // GetUserWithResponse Получить данные аутентифицированного пользователя // // Возвращает информацию о текущем аутентифицированном пользователе. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /user (the `GetUser` operationId). GetUserWithResponse(ctx context.Context, params *GetUserParams, reqEditors ...RequestEditorFn) (*GetUserResponse, error) // DeleteUserEmailsWithBodyWithResponse Удалить email-адреса // // Удаляет указанные email-адреса. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /user/emails (the `DeleteUserEmails` operationId). DeleteUserEmailsWithBodyWithResponse(ctx context.Context, params *DeleteUserEmailsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteUserEmailsResponse, error) // DeleteUserEmailsWithResponse Удалить email-адреса // // Удаляет указанные email-адреса. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /user/emails (the `DeleteUserEmails` operationId). DeleteUserEmailsWithResponse(ctx context.Context, params *DeleteUserEmailsParams, body DeleteUserEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteUserEmailsResponse, error) // GetUserEmailsWithResponse Получить список email-адресов // // Возвращает список email-адресов текущего пользователя. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /user/emails (the `GetUserEmails` operationId). GetUserEmailsWithResponse(ctx context.Context, params *GetUserEmailsParams, reqEditors ...RequestEditorFn) (*GetUserEmailsResponse, error) // PostUserEmailsWithBodyWithResponse Добавить email-адреса // // Добавляет один или несколько новых email-адресов текущему пользователю. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /user/emails (the `PostUserEmails` operationId). PostUserEmailsWithBodyWithResponse(ctx context.Context, params *PostUserEmailsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserEmailsResponse, error) // PostUserEmailsWithResponse Добавить email-адреса // // Добавляет один или несколько новых email-адресов текущему пользователю. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /user/emails (the `PostUserEmails` operationId). PostUserEmailsWithResponse(ctx context.Context, params *PostUserEmailsParams, body PostUserEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserEmailsResponse, error) // GetUserReposWithResponse Получить список репозиториев пользователя // // Возвращает все репозитории, доступные пользователю (личные и организации). // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /user/repos (the `GetUserRepos` operationId). GetUserReposWithResponse(ctx context.Context, params *GetUserReposParams, reqEditors ...RequestEditorFn) (*GetUserReposResponse, error) // PostUserReposWithBodyWithResponse Создать новый репозиторий // // Создаёт новый репозиторий для пользователя. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /user/repos (the `PostUserRepos` operationId). PostUserReposWithBodyWithResponse(ctx context.Context, params *PostUserReposParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserReposResponse, error) // PostUserReposWithResponse Создать новый репозиторий // // Создаёт новый репозиторий для пользователя. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /user/repos (the `PostUserRepos` operationId). PostUserReposWithResponse(ctx context.Context, params *PostUserReposParams, body PostUserReposJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserReposResponse, error) // GetUserStarredOwnerRepoWithResponse Проверить наличие звезды у репозитория // // Позволяет проверить, добавлен ли указанный репозиторий в список отслеживаемых у текущего пользователя. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /user/starred/{owner}/{repo} (the `GetUserStarredOwnerRepo` operationId). GetUserStarredOwnerRepoWithResponse(ctx context.Context, owner string, repo string, params *GetUserStarredOwnerRepoParams, reqEditors ...RequestEditorFn) (*GetUserStarredOwnerRepoResponse, error) // PutUserStarredOwnerRepoWithResponse Добавить звезду репозиторию // // Добавляет указанный репозиторий в список отслеживаемых пользователем («ставит звезду»). // // Returns a wrapper object for the known response body format(s). // // Corresponds with PUT /user/starred/{owner}/{repo} (the `PutUserStarredOwnerRepo` operationId). PutUserStarredOwnerRepoWithResponse(ctx context.Context, owner string, repo string, params *PutUserStarredOwnerRepoParams, reqEditors ...RequestEditorFn) (*PutUserStarredOwnerRepoResponse, error) // GetUsersUsernameWithResponse Получить данные пользователя по логину // // Позволяет получить информацию о любом пользователе по его логину. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /users/{username} (the `GetUsersUsername` operationId). GetUsersUsernameWithResponse(ctx context.Context, username string, params *GetUsersUsernameParams, reqEditors ...RequestEditorFn) (*GetUsersUsernameResponse, error) } type GetReposOwnerRepoResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *Repository } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoResponse) GetJSON200() *Repository { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoBranchesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *[]Branch } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoBranchesResponse) GetJSON200() *[]Branch { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoBranchesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoBranchesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoBranchesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoBranchesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type PutReposOwnerRepoCollaboratorsUsernameResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *CollaboratorInvite } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r PutReposOwnerRepoCollaboratorsUsernameResponse) GetJSON200() *CollaboratorInvite { return r.JSON200 } // GetBody returns the raw response body bytes func (r PutReposOwnerRepoCollaboratorsUsernameResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r PutReposOwnerRepoCollaboratorsUsernameResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PutReposOwnerRepoCollaboratorsUsernameResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r PutReposOwnerRepoCollaboratorsUsernameResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoCompareBaseheadResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *Comparison } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoCompareBaseheadResponse) GetJSON200() *Comparison { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoCompareBaseheadResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoCompareBaseheadResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoCompareBaseheadResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoCompareBaseheadResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type DeleteReposOwnerRepoContentsFilenameResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *struct { Commit *struct { // HtmlUrl Ссылка на коммит в веб-интерфейсе HtmlUrl *string `json:"html_url,omitempty"` // Sha SHA коммита Sha *string `json:"sha,omitempty"` // Url Ссылка на коммит Url *string `json:"url,omitempty"` } `json:"commit,omitempty"` // Content null, если файл удалён Content *string `json:"content,omitempty"` } } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r DeleteReposOwnerRepoContentsFilenameResponse) GetJSON200() *struct { Commit *struct { // HtmlUrl Ссылка на коммит в веб-интерфейсе HtmlUrl *string `json:"html_url,omitempty"` // Sha SHA коммита Sha *string `json:"sha,omitempty"` // Url Ссылка на коммит Url *string `json:"url,omitempty"` } `json:"commit,omitempty"` // Content null, если файл удалён Content *string `json:"content,omitempty"` } { return r.JSON200 } // GetBody returns the raw response body bytes func (r DeleteReposOwnerRepoContentsFilenameResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r DeleteReposOwnerRepoContentsFilenameResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteReposOwnerRepoContentsFilenameResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r DeleteReposOwnerRepoContentsFilenameResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type PutReposOwnerRepoContentsFilenameResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *struct { Commit *struct { // Sha SHA коммита Sha *string `json:"sha,omitempty"` // Url Ссылка на коммит Url *string `json:"url,omitempty"` } `json:"commit,omitempty"` Content *struct { // Name Имя файла Name *string `json:"name,omitempty"` // Path Путь к файлу Path *string `json:"path,omitempty"` // Sha SHA файла Sha *string `json:"sha,omitempty"` // Type Тип объекта Type *string `json:"type,omitempty"` } `json:"content,omitempty"` } } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r PutReposOwnerRepoContentsFilenameResponse) GetJSON200() *struct { Commit *struct { // Sha SHA коммита Sha *string `json:"sha,omitempty"` // Url Ссылка на коммит Url *string `json:"url,omitempty"` } `json:"commit,omitempty"` Content *struct { // Name Имя файла Name *string `json:"name,omitempty"` // Path Путь к файлу Path *string `json:"path,omitempty"` // Sha SHA файла Sha *string `json:"sha,omitempty"` // Type Тип объекта Type *string `json:"type,omitempty"` } `json:"content,omitempty"` } { return r.JSON200 } // GetBody returns the raw response body bytes func (r PutReposOwnerRepoContentsFilenameResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r PutReposOwnerRepoContentsFilenameResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PutReposOwnerRepoContentsFilenameResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r PutReposOwnerRepoContentsFilenameResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoContentsPathResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *GetReposOwnerRepoContentsPath200JSONResponseBody } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoContentsPathResponse) GetJSON200() *GetReposOwnerRepoContentsPath200JSONResponseBody { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoContentsPathResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoContentsPathResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoContentsPathResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoContentsPathResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type PostReposOwnerRepoForksResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *Repository } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r PostReposOwnerRepoForksResponse) GetJSON200() *Repository { return r.JSON200 } // GetBody returns the raw response body bytes func (r PostReposOwnerRepoForksResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r PostReposOwnerRepoForksResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PostReposOwnerRepoForksResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r PostReposOwnerRepoForksResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoGitTreesTreeShaResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *struct { // Sha SHA дерева Sha *string `json:"sha,omitempty"` Tree *[]struct { // Mode Режим файла (например, 100644 для blob, 040000 для дерева) Mode *string `json:"mode,omitempty"` // Path Путь к файлу или папке Path *string `json:"path,omitempty"` // Sha SHA хэш файла или дерева Sha *string `json:"sha,omitempty"` // Size Размер файла Size *int `json:"size,omitempty"` // Type Тип: file или dir Type *string `json:"type,omitempty"` // Url Ссылка на объект Url *string `json:"url,omitempty"` } `json:"tree,omitempty"` // Truncated Была ли обрезана выдача (если true) Truncated *bool `json:"truncated,omitempty"` // Url Ссылка на дерево Url *string `json:"url,omitempty"` } } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoGitTreesTreeShaResponse) GetJSON200() *struct { // Sha SHA дерева Sha *string `json:"sha,omitempty"` Tree *[]struct { // Mode Режим файла (например, 100644 для blob, 040000 для дерева) Mode *string `json:"mode,omitempty"` // Path Путь к файлу или папке Path *string `json:"path,omitempty"` // Sha SHA хэш файла или дерева Sha *string `json:"sha,omitempty"` // Size Размер файла Size *int `json:"size,omitempty"` // Type Тип: file или dir Type *string `json:"type,omitempty"` // Url Ссылка на объект Url *string `json:"url,omitempty"` } `json:"tree,omitempty"` // Truncated Была ли обрезана выдача (если true) Truncated *bool `json:"truncated,omitempty"` // Url Ссылка на дерево Url *string `json:"url,omitempty"` } { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoGitTreesTreeShaResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoGitTreesTreeShaResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoGitTreesTreeShaResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoGitTreesTreeShaResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoIssuesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *[]PullRequest } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoIssuesResponse) GetJSON200() *[]PullRequest { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoIssuesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoIssuesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoIssuesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoIssuesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoIssuesIndexCommentsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *[]Comment } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoIssuesIndexCommentsResponse) GetJSON200() *[]Comment { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoIssuesIndexCommentsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoIssuesIndexCommentsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoIssuesIndexCommentsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoIssuesIndexCommentsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoLanguagesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *LanguageStats } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoLanguagesResponse) GetJSON200() *LanguageStats { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoLanguagesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoLanguagesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoLanguagesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoLanguagesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoPullsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *[]PullRequestDetail } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoPullsResponse) GetJSON200() *[]PullRequestDetail { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoPullsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoPullsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoPullsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoPullsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type PostReposOwnerRepoPullsResponse struct { Body []byte HTTPResponse *http.Response // JSON201 the response for an HTTP 201 `application/json` response JSON201 *PullRequest } // GetJSON201 returns the response for an HTTP 201 `application/json` response func (r PostReposOwnerRepoPullsResponse) GetJSON201() *PullRequest { return r.JSON201 } // GetBody returns the raw response body bytes func (r PostReposOwnerRepoPullsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r PostReposOwnerRepoPullsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PostReposOwnerRepoPullsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r PostReposOwnerRepoPullsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoPullsPullNumberResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *PullRequestDetail } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoPullsPullNumberResponse) GetJSON200() *PullRequestDetail { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoPullsPullNumberResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoPullsPullNumberResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoPullsPullNumberResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoPullsPullNumberResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type PatchReposOwnerRepoPullsPullNumberResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *PullRequestDetail } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r PatchReposOwnerRepoPullsPullNumberResponse) GetJSON200() *PullRequestDetail { return r.JSON200 } // GetBody returns the raw response body bytes func (r PatchReposOwnerRepoPullsPullNumberResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r PatchReposOwnerRepoPullsPullNumberResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PatchReposOwnerRepoPullsPullNumberResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r PatchReposOwnerRepoPullsPullNumberResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoPullsPullNumberFilesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *[]PullRequestFile } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoPullsPullNumberFilesResponse) GetJSON200() *[]PullRequestFile { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoPullsPullNumberFilesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoPullsPullNumberFilesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoPullsPullNumberFilesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoPullsPullNumberFilesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetReposOwnerRepoPullsPullNumberMergeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *struct { // Mergeable Можно ли выполнить merge Mergeable *bool `json:"mergeable,omitempty"` // Merged Слит ли PR Merged *bool `json:"merged,omitempty"` // Message Сообщение о статусе Message *string `json:"message,omitempty"` } } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetReposOwnerRepoPullsPullNumberMergeResponse) GetJSON200() *struct { // Mergeable Можно ли выполнить merge Mergeable *bool `json:"mergeable,omitempty"` // Merged Слит ли PR Merged *bool `json:"merged,omitempty"` // Message Сообщение о статусе Message *string `json:"message,omitempty"` } { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetReposOwnerRepoPullsPullNumberMergeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetReposOwnerRepoPullsPullNumberMergeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetReposOwnerRepoPullsPullNumberMergeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetReposOwnerRepoPullsPullNumberMergeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetUserResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *User } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetUserResponse) GetJSON200() *User { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetUserResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetUserResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type DeleteUserEmailsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *struct { // DeletedEmails Удалённые email-адреса DeletedEmails *[]openapi_types.Email `json:"deleted_emails,omitempty"` // Message Сообщение Message *string `json:"message,omitempty"` // Status Код статуса Status *int `json:"status,omitempty"` } } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r DeleteUserEmailsResponse) GetJSON200() *struct { // DeletedEmails Удалённые email-адреса DeletedEmails *[]openapi_types.Email `json:"deleted_emails,omitempty"` // Message Сообщение Message *string `json:"message,omitempty"` // Status Код статуса Status *int `json:"status,omitempty"` } { return r.JSON200 } // GetBody returns the raw response body bytes func (r DeleteUserEmailsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r DeleteUserEmailsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteUserEmailsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r DeleteUserEmailsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetUserEmailsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *[]Email } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetUserEmailsResponse) GetJSON200() *[]Email { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetUserEmailsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetUserEmailsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetUserEmailsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetUserEmailsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type PostUserEmailsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *[]Email } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r PostUserEmailsResponse) GetJSON200() *[]Email { return r.JSON200 } // GetBody returns the raw response body bytes func (r PostUserEmailsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r PostUserEmailsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PostUserEmailsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r PostUserEmailsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetUserReposResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *[]Repository } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetUserReposResponse) GetJSON200() *[]Repository { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetUserReposResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetUserReposResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetUserReposResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetUserReposResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type PostUserReposResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *Repository } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r PostUserReposResponse) GetJSON200() *Repository { return r.JSON200 } // GetBody returns the raw response body bytes func (r PostUserReposResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r PostUserReposResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PostUserReposResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r PostUserReposResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetUserStarredOwnerRepoResponse struct { Body []byte HTTPResponse *http.Response } // GetBody returns the raw response body bytes func (r GetUserStarredOwnerRepoResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetUserStarredOwnerRepoResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetUserStarredOwnerRepoResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetUserStarredOwnerRepoResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type PutUserStarredOwnerRepoResponse struct { Body []byte HTTPResponse *http.Response } // GetBody returns the raw response body bytes func (r PutUserStarredOwnerRepoResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r PutUserStarredOwnerRepoResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r PutUserStarredOwnerRepoResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r PutUserStarredOwnerRepoResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetUsersUsernameResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *User } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetUsersUsernameResponse) GetJSON200() *User { return r.JSON200 } // GetBody returns the raw response body bytes func (r GetUsersUsernameResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetUsersUsernameResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetUsersUsernameResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetUsersUsernameResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } // GetReposOwnerRepoWithResponse Получить информацию о репозитории // // Возвращает основные данные о репозитории: название, владельца, настройки, права пользователя и т.д. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo} (the `GetReposOwnerRepo` operationId). func (c *ClientWithResponses) GetReposOwnerRepoWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoResponse, error) { rsp, err := c.GetReposOwnerRepo(ctx, owner, repo, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoResponse(rsp) } // GetReposOwnerRepoBranchesWithResponse Получить список веток репозитория // // Возвращает список всех веток репозитория с информацией о последнем коммите и защите веток. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/branches (the `GetReposOwnerRepoBranches` operationId). func (c *ClientWithResponses) GetReposOwnerRepoBranchesWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoBranchesParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoBranchesResponse, error) { rsp, err := c.GetReposOwnerRepoBranches(ctx, owner, repo, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoBranchesResponse(rsp) } // PutReposOwnerRepoCollaboratorsUsernameWithBodyWithResponse Добавить или обновить права пользователя // // Добавляет пользователя как соавтора репозитория или обновляет его уровень доступа. Требуются права администратора текущего репозитория для выполнения операции. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /repos/{owner}/{repo}/collaborators/{username} (the `PutReposOwnerRepoCollaboratorsUsername` operationId). func (c *ClientWithResponses) PutReposOwnerRepoCollaboratorsUsernameWithBodyWithResponse(ctx context.Context, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutReposOwnerRepoCollaboratorsUsernameResponse, error) { rsp, err := c.PutReposOwnerRepoCollaboratorsUsernameWithBody(ctx, owner, repo, username, params, contentType, body, reqEditors...) if err != nil { return nil, err } return ParsePutReposOwnerRepoCollaboratorsUsernameResponse(rsp) } // PutReposOwnerRepoCollaboratorsUsernameWithResponse Добавить или обновить права пользователя // // Добавляет пользователя как соавтора репозитория или обновляет его уровень доступа. Требуются права администратора текущего репозитория для выполнения операции. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /repos/{owner}/{repo}/collaborators/{username} (the `PutReposOwnerRepoCollaboratorsUsername` operationId). func (c *ClientWithResponses) PutReposOwnerRepoCollaboratorsUsernameWithResponse(ctx context.Context, owner string, repo string, username string, params *PutReposOwnerRepoCollaboratorsUsernameParams, body PutReposOwnerRepoCollaboratorsUsernameJSONRequestBody, reqEditors ...RequestEditorFn) (*PutReposOwnerRepoCollaboratorsUsernameResponse, error) { rsp, err := c.PutReposOwnerRepoCollaboratorsUsername(ctx, owner, repo, username, params, body, reqEditors...) if err != nil { return nil, err } return ParsePutReposOwnerRepoCollaboratorsUsernameResponse(rsp) } // GetReposOwnerRepoCompareBaseheadWithResponse Сравнить коммиты или ветки // // Сравнивает два коммита, ветки или тега. Параметр basehead в формате base...head. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/compare/{basehead} (the `GetReposOwnerRepoCompareBasehead` operationId). func (c *ClientWithResponses) GetReposOwnerRepoCompareBaseheadWithResponse(ctx context.Context, owner string, repo string, basehead string, params *GetReposOwnerRepoCompareBaseheadParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoCompareBaseheadResponse, error) { rsp, err := c.GetReposOwnerRepoCompareBasehead(ctx, owner, repo, basehead, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoCompareBaseheadResponse(rsp) } // DeleteReposOwnerRepoContentsFilenameWithBodyWithResponse Удалить файл // // Удаляет указанный файл из репозитория. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /repos/{owner}/{repo}/contents/{filename} (the `DeleteReposOwnerRepoContentsFilename` operationId). func (c *ClientWithResponses) DeleteReposOwnerRepoContentsFilenameWithBodyWithResponse(ctx context.Context, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteReposOwnerRepoContentsFilenameResponse, error) { rsp, err := c.DeleteReposOwnerRepoContentsFilenameWithBody(ctx, owner, repo, filename, params, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseDeleteReposOwnerRepoContentsFilenameResponse(rsp) } // DeleteReposOwnerRepoContentsFilenameWithResponse Удалить файл // // Удаляет указанный файл из репозитория. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /repos/{owner}/{repo}/contents/{filename} (the `DeleteReposOwnerRepoContentsFilename` operationId). func (c *ClientWithResponses) DeleteReposOwnerRepoContentsFilenameWithResponse(ctx context.Context, owner string, repo string, filename string, params *DeleteReposOwnerRepoContentsFilenameParams, body DeleteReposOwnerRepoContentsFilenameJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteReposOwnerRepoContentsFilenameResponse, error) { rsp, err := c.DeleteReposOwnerRepoContentsFilename(ctx, owner, repo, filename, params, body, reqEditors...) if err != nil { return nil, err } return ParseDeleteReposOwnerRepoContentsFilenameResponse(rsp) } // PutReposOwnerRepoContentsFilenameWithBodyWithResponse Создать или обновить файл // // Создаёт новый файл или обновляет существующий в указанной ветке. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /repos/{owner}/{repo}/contents/{filename} (the `PutReposOwnerRepoContentsFilename` operationId). func (c *ClientWithResponses) PutReposOwnerRepoContentsFilenameWithBodyWithResponse(ctx context.Context, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutReposOwnerRepoContentsFilenameResponse, error) { rsp, err := c.PutReposOwnerRepoContentsFilenameWithBody(ctx, owner, repo, filename, params, contentType, body, reqEditors...) if err != nil { return nil, err } return ParsePutReposOwnerRepoContentsFilenameResponse(rsp) } // PutReposOwnerRepoContentsFilenameWithResponse Создать или обновить файл // // Создаёт новый файл или обновляет существующий в указанной ветке. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /repos/{owner}/{repo}/contents/{filename} (the `PutReposOwnerRepoContentsFilename` operationId). func (c *ClientWithResponses) PutReposOwnerRepoContentsFilenameWithResponse(ctx context.Context, owner string, repo string, filename string, params *PutReposOwnerRepoContentsFilenameParams, body PutReposOwnerRepoContentsFilenameJSONRequestBody, reqEditors ...RequestEditorFn) (*PutReposOwnerRepoContentsFilenameResponse, error) { rsp, err := c.PutReposOwnerRepoContentsFilename(ctx, owner, repo, filename, params, body, reqEditors...) if err != nil { return nil, err } return ParsePutReposOwnerRepoContentsFilenameResponse(rsp) } // GetReposOwnerRepoContentsPathWithResponse Получить содержимое файла или папки // // Позволяет получить содержимое файла (в Base64) или список файлов внутри папки. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/contents/{path} (the `GetReposOwnerRepoContentsPath` operationId). func (c *ClientWithResponses) GetReposOwnerRepoContentsPathWithResponse(ctx context.Context, owner string, repo string, path string, params *GetReposOwnerRepoContentsPathParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoContentsPathResponse, error) { rsp, err := c.GetReposOwnerRepoContentsPath(ctx, owner, repo, path, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoContentsPathResponse(rsp) } // PostReposOwnerRepoForksWithResponse Создать форк репозитория // // Создаёт форк репозитория для текущего пользователя. // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /repos/{owner}/{repo}/forks (the `PostReposOwnerRepoForks` operationId). func (c *ClientWithResponses) PostReposOwnerRepoForksWithResponse(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoForksParams, reqEditors ...RequestEditorFn) (*PostReposOwnerRepoForksResponse, error) { rsp, err := c.PostReposOwnerRepoForks(ctx, owner, repo, params, reqEditors...) if err != nil { return nil, err } return ParsePostReposOwnerRepoForksResponse(rsp) } // GetReposOwnerRepoGitTreesTreeShaWithResponse Получить git-дерево // // Возвращает структуру файлов и папок, связанную с указанным деревом Git. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/git/trees/{tree_sha} (the `GetReposOwnerRepoGitTreesTreeSha` operationId). func (c *ClientWithResponses) GetReposOwnerRepoGitTreesTreeShaWithResponse(ctx context.Context, owner string, repo string, treeSha string, params *GetReposOwnerRepoGitTreesTreeShaParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoGitTreesTreeShaResponse, error) { rsp, err := c.GetReposOwnerRepoGitTreesTreeSha(ctx, owner, repo, treeSha, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoGitTreesTreeShaResponse(rsp) } // GetReposOwnerRepoIssuesWithResponse Получить список задач (issues) // // Возвращает список задач (issues). На данный момент содержит только запросы на слияние (Pull Requests). Полноценная поддержка задач будет добавлена позже. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/issues (the `GetReposOwnerRepoIssues` operationId). func (c *ClientWithResponses) GetReposOwnerRepoIssuesWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoIssuesParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoIssuesResponse, error) { rsp, err := c.GetReposOwnerRepoIssues(ctx, owner, repo, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoIssuesResponse(rsp) } // GetReposOwnerRepoIssuesIndexCommentsWithResponse Получить комментарии к задаче или Pull Request // // Возвращает список комментариев для указанной задачи или Pull Request по её номеру. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/issues/{index}/comments (the `GetReposOwnerRepoIssuesIndexComments` operationId). func (c *ClientWithResponses) GetReposOwnerRepoIssuesIndexCommentsWithResponse(ctx context.Context, owner string, repo string, index int, params *GetReposOwnerRepoIssuesIndexCommentsParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoIssuesIndexCommentsResponse, error) { rsp, err := c.GetReposOwnerRepoIssuesIndexComments(ctx, owner, repo, index, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoIssuesIndexCommentsResponse(rsp) } // GetReposOwnerRepoLanguagesWithResponse Получить языки программирования // // Возвращает список языков, используемых в репозитории, с указанием количества строк кода на каждом. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/languages (the `GetReposOwnerRepoLanguages` operationId). func (c *ClientWithResponses) GetReposOwnerRepoLanguagesWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoLanguagesParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoLanguagesResponse, error) { rsp, err := c.GetReposOwnerRepoLanguages(ctx, owner, repo, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoLanguagesResponse(rsp) } // GetReposOwnerRepoPullsWithResponse Получить список Pull Request'ов // // Возвращает список Pull Request'ов для указанного репозитория. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/pulls (the `GetReposOwnerRepoPulls` operationId). func (c *ClientWithResponses) GetReposOwnerRepoPullsWithResponse(ctx context.Context, owner string, repo string, params *GetReposOwnerRepoPullsParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoPullsResponse, error) { rsp, err := c.GetReposOwnerRepoPulls(ctx, owner, repo, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoPullsResponse(rsp) } // PostReposOwnerRepoPullsWithBodyWithResponse Создать Pull Request // // Создаёт новый запрос на слияние из указанной ветки в целевую. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /repos/{owner}/{repo}/pulls (the `PostReposOwnerRepoPulls` operationId). func (c *ClientWithResponses) PostReposOwnerRepoPullsWithBodyWithResponse(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoPullsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostReposOwnerRepoPullsResponse, error) { rsp, err := c.PostReposOwnerRepoPullsWithBody(ctx, owner, repo, params, contentType, body, reqEditors...) if err != nil { return nil, err } return ParsePostReposOwnerRepoPullsResponse(rsp) } // PostReposOwnerRepoPullsWithResponse Создать Pull Request // // Создаёт новый запрос на слияние из указанной ветки в целевую. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /repos/{owner}/{repo}/pulls (the `PostReposOwnerRepoPulls` operationId). func (c *ClientWithResponses) PostReposOwnerRepoPullsWithResponse(ctx context.Context, owner string, repo string, params *PostReposOwnerRepoPullsParams, body PostReposOwnerRepoPullsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostReposOwnerRepoPullsResponse, error) { rsp, err := c.PostReposOwnerRepoPulls(ctx, owner, repo, params, body, reqEditors...) if err != nil { return nil, err } return ParsePostReposOwnerRepoPullsResponse(rsp) } // GetReposOwnerRepoPullsPullNumberWithResponse Получить информацию о Pull Request // // Возвращает детальную информацию о конкретном Pull Request. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number} (the `GetReposOwnerRepoPullsPullNumber` operationId). func (c *ClientWithResponses) GetReposOwnerRepoPullsPullNumberWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoPullsPullNumberResponse, error) { rsp, err := c.GetReposOwnerRepoPullsPullNumber(ctx, owner, repo, pullNumber, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoPullsPullNumberResponse(rsp) } // PatchReposOwnerRepoPullsPullNumberWithBodyWithResponse Обновить Pull Request // // Обновляет заголовок, описание или другие поля Pull Request. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PATCH /repos/{owner}/{repo}/pulls/{pull_number} (the `PatchReposOwnerRepoPullsPullNumber` operationId). func (c *ClientWithResponses) PatchReposOwnerRepoPullsPullNumberWithBodyWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchReposOwnerRepoPullsPullNumberResponse, error) { rsp, err := c.PatchReposOwnerRepoPullsPullNumberWithBody(ctx, owner, repo, pullNumber, params, contentType, body, reqEditors...) if err != nil { return nil, err } return ParsePatchReposOwnerRepoPullsPullNumberResponse(rsp) } // PatchReposOwnerRepoPullsPullNumberWithResponse Обновить Pull Request // // Обновляет заголовок, описание или другие поля Pull Request. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PATCH /repos/{owner}/{repo}/pulls/{pull_number} (the `PatchReposOwnerRepoPullsPullNumber` operationId). func (c *ClientWithResponses) PatchReposOwnerRepoPullsPullNumberWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *PatchReposOwnerRepoPullsPullNumberParams, body PatchReposOwnerRepoPullsPullNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchReposOwnerRepoPullsPullNumberResponse, error) { rsp, err := c.PatchReposOwnerRepoPullsPullNumber(ctx, owner, repo, pullNumber, params, body, reqEditors...) if err != nil { return nil, err } return ParsePatchReposOwnerRepoPullsPullNumberResponse(rsp) } // GetReposOwnerRepoPullsPullNumberFilesWithResponse Получить файлы Pull Request // // Возвращает список файлов, изменённых в Pull Request. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number}/files (the `GetReposOwnerRepoPullsPullNumberFiles` operationId). func (c *ClientWithResponses) GetReposOwnerRepoPullsPullNumberFilesWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberFilesParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoPullsPullNumberFilesResponse, error) { rsp, err := c.GetReposOwnerRepoPullsPullNumberFiles(ctx, owner, repo, pullNumber, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoPullsPullNumberFilesResponse(rsp) } // GetReposOwnerRepoPullsPullNumberMergeWithResponse Проверить статус merge Pull Request // // Проверяет, может ли Pull Request быть слит. Не выполняет merge. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /repos/{owner}/{repo}/pulls/{pull_number}/merge (the `GetReposOwnerRepoPullsPullNumberMerge` operationId). func (c *ClientWithResponses) GetReposOwnerRepoPullsPullNumberMergeWithResponse(ctx context.Context, owner string, repo string, pullNumber int, params *GetReposOwnerRepoPullsPullNumberMergeParams, reqEditors ...RequestEditorFn) (*GetReposOwnerRepoPullsPullNumberMergeResponse, error) { rsp, err := c.GetReposOwnerRepoPullsPullNumberMerge(ctx, owner, repo, pullNumber, params, reqEditors...) if err != nil { return nil, err } return ParseGetReposOwnerRepoPullsPullNumberMergeResponse(rsp) } // GetUserWithResponse Получить данные аутентифицированного пользователя // // Возвращает информацию о текущем аутентифицированном пользователе. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /user (the `GetUser` operationId). func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, params *GetUserParams, reqEditors ...RequestEditorFn) (*GetUserResponse, error) { rsp, err := c.GetUser(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseGetUserResponse(rsp) } // DeleteUserEmailsWithBodyWithResponse Удалить email-адреса // // Удаляет указанные email-адреса. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /user/emails (the `DeleteUserEmails` operationId). func (c *ClientWithResponses) DeleteUserEmailsWithBodyWithResponse(ctx context.Context, params *DeleteUserEmailsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteUserEmailsResponse, error) { rsp, err := c.DeleteUserEmailsWithBody(ctx, params, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseDeleteUserEmailsResponse(rsp) } // DeleteUserEmailsWithResponse Удалить email-адреса // // Удаляет указанные email-адреса. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /user/emails (the `DeleteUserEmails` operationId). func (c *ClientWithResponses) DeleteUserEmailsWithResponse(ctx context.Context, params *DeleteUserEmailsParams, body DeleteUserEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteUserEmailsResponse, error) { rsp, err := c.DeleteUserEmails(ctx, params, body, reqEditors...) if err != nil { return nil, err } return ParseDeleteUserEmailsResponse(rsp) } // GetUserEmailsWithResponse Получить список email-адресов // // Возвращает список email-адресов текущего пользователя. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /user/emails (the `GetUserEmails` operationId). func (c *ClientWithResponses) GetUserEmailsWithResponse(ctx context.Context, params *GetUserEmailsParams, reqEditors ...RequestEditorFn) (*GetUserEmailsResponse, error) { rsp, err := c.GetUserEmails(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseGetUserEmailsResponse(rsp) } // PostUserEmailsWithBodyWithResponse Добавить email-адреса // // Добавляет один или несколько новых email-адресов текущему пользователю. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /user/emails (the `PostUserEmails` operationId). func (c *ClientWithResponses) PostUserEmailsWithBodyWithResponse(ctx context.Context, params *PostUserEmailsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserEmailsResponse, error) { rsp, err := c.PostUserEmailsWithBody(ctx, params, contentType, body, reqEditors...) if err != nil { return nil, err } return ParsePostUserEmailsResponse(rsp) } // PostUserEmailsWithResponse Добавить email-адреса // // Добавляет один или несколько новых email-адресов текущему пользователю. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /user/emails (the `PostUserEmails` operationId). func (c *ClientWithResponses) PostUserEmailsWithResponse(ctx context.Context, params *PostUserEmailsParams, body PostUserEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserEmailsResponse, error) { rsp, err := c.PostUserEmails(ctx, params, body, reqEditors...) if err != nil { return nil, err } return ParsePostUserEmailsResponse(rsp) } // GetUserReposWithResponse Получить список репозиториев пользователя // // Возвращает все репозитории, доступные пользователю (личные и организации). // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /user/repos (the `GetUserRepos` operationId). func (c *ClientWithResponses) GetUserReposWithResponse(ctx context.Context, params *GetUserReposParams, reqEditors ...RequestEditorFn) (*GetUserReposResponse, error) { rsp, err := c.GetUserRepos(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseGetUserReposResponse(rsp) } // PostUserReposWithBodyWithResponse Создать новый репозиторий // // Создаёт новый репозиторий для пользователя. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /user/repos (the `PostUserRepos` operationId). func (c *ClientWithResponses) PostUserReposWithBodyWithResponse(ctx context.Context, params *PostUserReposParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserReposResponse, error) { rsp, err := c.PostUserReposWithBody(ctx, params, contentType, body, reqEditors...) if err != nil { return nil, err } return ParsePostUserReposResponse(rsp) } // PostUserReposWithResponse Создать новый репозиторий // // Создаёт новый репозиторий для пользователя. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /user/repos (the `PostUserRepos` operationId). func (c *ClientWithResponses) PostUserReposWithResponse(ctx context.Context, params *PostUserReposParams, body PostUserReposJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserReposResponse, error) { rsp, err := c.PostUserRepos(ctx, params, body, reqEditors...) if err != nil { return nil, err } return ParsePostUserReposResponse(rsp) } // GetUserStarredOwnerRepoWithResponse Проверить наличие звезды у репозитория // // Позволяет проверить, добавлен ли указанный репозиторий в список отслеживаемых у текущего пользователя. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /user/starred/{owner}/{repo} (the `GetUserStarredOwnerRepo` operationId). func (c *ClientWithResponses) GetUserStarredOwnerRepoWithResponse(ctx context.Context, owner string, repo string, params *GetUserStarredOwnerRepoParams, reqEditors ...RequestEditorFn) (*GetUserStarredOwnerRepoResponse, error) { rsp, err := c.GetUserStarredOwnerRepo(ctx, owner, repo, params, reqEditors...) if err != nil { return nil, err } return ParseGetUserStarredOwnerRepoResponse(rsp) } // PutUserStarredOwnerRepoWithResponse Добавить звезду репозиторию // // Добавляет указанный репозиторий в список отслеживаемых пользователем («ставит звезду»). // // Returns a wrapper object for the known response body format(s). // // Corresponds with PUT /user/starred/{owner}/{repo} (the `PutUserStarredOwnerRepo` operationId). func (c *ClientWithResponses) PutUserStarredOwnerRepoWithResponse(ctx context.Context, owner string, repo string, params *PutUserStarredOwnerRepoParams, reqEditors ...RequestEditorFn) (*PutUserStarredOwnerRepoResponse, error) { rsp, err := c.PutUserStarredOwnerRepo(ctx, owner, repo, params, reqEditors...) if err != nil { return nil, err } return ParsePutUserStarredOwnerRepoResponse(rsp) } // GetUsersUsernameWithResponse Получить данные пользователя по логину // // Позволяет получить информацию о любом пользователе по его логину. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /users/{username} (the `GetUsersUsername` operationId). func (c *ClientWithResponses) GetUsersUsernameWithResponse(ctx context.Context, username string, params *GetUsersUsernameParams, reqEditors ...RequestEditorFn) (*GetUsersUsernameResponse, error) { rsp, err := c.GetUsersUsername(ctx, username, params, reqEditors...) if err != nil { return nil, err } return ParseGetUsersUsernameResponse(rsp) } // ParseGetReposOwnerRepoResponse parses an HTTP response from a GetReposOwnerRepoWithResponse call func ParseGetReposOwnerRepoResponse(rsp *http.Response) (*GetReposOwnerRepoResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest Repository if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoBranchesResponse parses an HTTP response from a GetReposOwnerRepoBranchesWithResponse call func ParseGetReposOwnerRepoBranchesResponse(rsp *http.Response) (*GetReposOwnerRepoBranchesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoBranchesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest []Branch if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParsePutReposOwnerRepoCollaboratorsUsernameResponse parses an HTTP response from a PutReposOwnerRepoCollaboratorsUsernameWithResponse call func ParsePutReposOwnerRepoCollaboratorsUsernameResponse(rsp *http.Response) (*PutReposOwnerRepoCollaboratorsUsernameResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PutReposOwnerRepoCollaboratorsUsernameResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest CollaboratorInvite if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoCompareBaseheadResponse parses an HTTP response from a GetReposOwnerRepoCompareBaseheadWithResponse call func ParseGetReposOwnerRepoCompareBaseheadResponse(rsp *http.Response) (*GetReposOwnerRepoCompareBaseheadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoCompareBaseheadResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest Comparison if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseDeleteReposOwnerRepoContentsFilenameResponse parses an HTTP response from a DeleteReposOwnerRepoContentsFilenameWithResponse call func ParseDeleteReposOwnerRepoContentsFilenameResponse(rsp *http.Response) (*DeleteReposOwnerRepoContentsFilenameResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteReposOwnerRepoContentsFilenameResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { Commit *struct { // HtmlUrl Ссылка на коммит в веб-интерфейсе HtmlUrl *string `json:"html_url,omitempty"` // Sha SHA коммита Sha *string `json:"sha,omitempty"` // Url Ссылка на коммит Url *string `json:"url,omitempty"` } `json:"commit,omitempty"` // Content null, если файл удалён Content *string `json:"content,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParsePutReposOwnerRepoContentsFilenameResponse parses an HTTP response from a PutReposOwnerRepoContentsFilenameWithResponse call func ParsePutReposOwnerRepoContentsFilenameResponse(rsp *http.Response) (*PutReposOwnerRepoContentsFilenameResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PutReposOwnerRepoContentsFilenameResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { Commit *struct { // Sha SHA коммита Sha *string `json:"sha,omitempty"` // Url Ссылка на коммит Url *string `json:"url,omitempty"` } `json:"commit,omitempty"` Content *struct { // Name Имя файла Name *string `json:"name,omitempty"` // Path Путь к файлу Path *string `json:"path,omitempty"` // Sha SHA файла Sha *string `json:"sha,omitempty"` // Type Тип объекта Type *string `json:"type,omitempty"` } `json:"content,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoContentsPathResponse parses an HTTP response from a GetReposOwnerRepoContentsPathWithResponse call func ParseGetReposOwnerRepoContentsPathResponse(rsp *http.Response) (*GetReposOwnerRepoContentsPathResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoContentsPathResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest GetReposOwnerRepoContentsPath200JSONResponseBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParsePostReposOwnerRepoForksResponse parses an HTTP response from a PostReposOwnerRepoForksWithResponse call func ParsePostReposOwnerRepoForksResponse(rsp *http.Response) (*PostReposOwnerRepoForksResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PostReposOwnerRepoForksResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest Repository if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoGitTreesTreeShaResponse parses an HTTP response from a GetReposOwnerRepoGitTreesTreeShaWithResponse call func ParseGetReposOwnerRepoGitTreesTreeShaResponse(rsp *http.Response) (*GetReposOwnerRepoGitTreesTreeShaResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoGitTreesTreeShaResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { // Sha SHA дерева Sha *string `json:"sha,omitempty"` Tree *[]struct { // Mode Режим файла (например, 100644 для blob, 040000 для дерева) Mode *string `json:"mode,omitempty"` // Path Путь к файлу или папке Path *string `json:"path,omitempty"` // Sha SHA хэш файла или дерева Sha *string `json:"sha,omitempty"` // Size Размер файла Size *int `json:"size,omitempty"` // Type Тип: file или dir Type *string `json:"type,omitempty"` // Url Ссылка на объект Url *string `json:"url,omitempty"` } `json:"tree,omitempty"` // Truncated Была ли обрезана выдача (если true) Truncated *bool `json:"truncated,omitempty"` // Url Ссылка на дерево Url *string `json:"url,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoIssuesResponse parses an HTTP response from a GetReposOwnerRepoIssuesWithResponse call func ParseGetReposOwnerRepoIssuesResponse(rsp *http.Response) (*GetReposOwnerRepoIssuesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoIssuesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest []PullRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoIssuesIndexCommentsResponse parses an HTTP response from a GetReposOwnerRepoIssuesIndexCommentsWithResponse call func ParseGetReposOwnerRepoIssuesIndexCommentsResponse(rsp *http.Response) (*GetReposOwnerRepoIssuesIndexCommentsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoIssuesIndexCommentsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest []Comment if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoLanguagesResponse parses an HTTP response from a GetReposOwnerRepoLanguagesWithResponse call func ParseGetReposOwnerRepoLanguagesResponse(rsp *http.Response) (*GetReposOwnerRepoLanguagesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoLanguagesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest LanguageStats if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoPullsResponse parses an HTTP response from a GetReposOwnerRepoPullsWithResponse call func ParseGetReposOwnerRepoPullsResponse(rsp *http.Response) (*GetReposOwnerRepoPullsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoPullsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest []PullRequestDetail if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParsePostReposOwnerRepoPullsResponse parses an HTTP response from a PostReposOwnerRepoPullsWithResponse call func ParsePostReposOwnerRepoPullsResponse(rsp *http.Response) (*PostReposOwnerRepoPullsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PostReposOwnerRepoPullsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: var dest PullRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON201 = &dest } return response, nil } // ParseGetReposOwnerRepoPullsPullNumberResponse parses an HTTP response from a GetReposOwnerRepoPullsPullNumberWithResponse call func ParseGetReposOwnerRepoPullsPullNumberResponse(rsp *http.Response) (*GetReposOwnerRepoPullsPullNumberResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoPullsPullNumberResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PullRequestDetail if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParsePatchReposOwnerRepoPullsPullNumberResponse parses an HTTP response from a PatchReposOwnerRepoPullsPullNumberWithResponse call func ParsePatchReposOwnerRepoPullsPullNumberResponse(rsp *http.Response) (*PatchReposOwnerRepoPullsPullNumberResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PatchReposOwnerRepoPullsPullNumberResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PullRequestDetail if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoPullsPullNumberFilesResponse parses an HTTP response from a GetReposOwnerRepoPullsPullNumberFilesWithResponse call func ParseGetReposOwnerRepoPullsPullNumberFilesResponse(rsp *http.Response) (*GetReposOwnerRepoPullsPullNumberFilesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoPullsPullNumberFilesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest []PullRequestFile if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetReposOwnerRepoPullsPullNumberMergeResponse parses an HTTP response from a GetReposOwnerRepoPullsPullNumberMergeWithResponse call func ParseGetReposOwnerRepoPullsPullNumberMergeResponse(rsp *http.Response) (*GetReposOwnerRepoPullsPullNumberMergeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetReposOwnerRepoPullsPullNumberMergeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { // Mergeable Можно ли выполнить merge Mergeable *bool `json:"mergeable,omitempty"` // Merged Слит ли PR Merged *bool `json:"merged,omitempty"` // Message Сообщение о статусе Message *string `json:"message,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetUserResponse parses an HTTP response from a GetUserWithResponse call func ParseGetUserResponse(rsp *http.Response) (*GetUserResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest User if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseDeleteUserEmailsResponse parses an HTTP response from a DeleteUserEmailsWithResponse call func ParseDeleteUserEmailsResponse(rsp *http.Response) (*DeleteUserEmailsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteUserEmailsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { // DeletedEmails Удалённые email-адреса DeletedEmails *[]openapi_types.Email `json:"deleted_emails,omitempty"` // Message Сообщение Message *string `json:"message,omitempty"` // Status Код статуса Status *int `json:"status,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetUserEmailsResponse parses an HTTP response from a GetUserEmailsWithResponse call func ParseGetUserEmailsResponse(rsp *http.Response) (*GetUserEmailsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetUserEmailsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest []Email if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParsePostUserEmailsResponse parses an HTTP response from a PostUserEmailsWithResponse call func ParsePostUserEmailsResponse(rsp *http.Response) (*PostUserEmailsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PostUserEmailsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest []Email if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetUserReposResponse parses an HTTP response from a GetUserReposWithResponse call func ParseGetUserReposResponse(rsp *http.Response) (*GetUserReposResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetUserReposResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest []Repository if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParsePostUserReposResponse parses an HTTP response from a PostUserReposWithResponse call func ParsePostUserReposResponse(rsp *http.Response) (*PostUserReposResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PostUserReposResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest Repository if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil } // ParseGetUserStarredOwnerRepoResponse parses an HTTP response from a GetUserStarredOwnerRepoWithResponse call func ParseGetUserStarredOwnerRepoResponse(rsp *http.Response) (*GetUserStarredOwnerRepoResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetUserStarredOwnerRepoResponse{ Body: bodyBytes, HTTPResponse: rsp, } return response, nil } // ParsePutUserStarredOwnerRepoResponse parses an HTTP response from a PutUserStarredOwnerRepoWithResponse call func ParsePutUserStarredOwnerRepoResponse(rsp *http.Response) (*PutUserStarredOwnerRepoResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &PutUserStarredOwnerRepoResponse{ Body: bodyBytes, HTTPResponse: rsp, } return response, nil } // ParseGetUsersUsernameResponse parses an HTTP response from a GetUsersUsernameWithResponse call func ParseGetUsersUsernameResponse(rsp *http.Response) (*GetUsersUsernameResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetUsersUsernameResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest User if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest } return response, nil }