mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-12-24 03:28:28 +00:00
1741 lines
58 KiB
Go
1741 lines
58 KiB
Go
/*
|
|
* peridot/proto/v1/batch.proto
|
|
*
|
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
*
|
|
* API version: version not set
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package peridotopenapi
|
|
|
|
import (
|
|
"bytes"
|
|
_context "context"
|
|
_ioutil "io/ioutil"
|
|
_nethttp "net/http"
|
|
_neturl "net/url"
|
|
"strings"
|
|
)
|
|
|
|
// Linger please
|
|
var (
|
|
_ _context.Context
|
|
)
|
|
|
|
type ProjectServiceApi interface {
|
|
|
|
/*
|
|
* CreateHashedRepositories Method for CreateHashedRepositories
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiCreateHashedRepositoriesRequest
|
|
*/
|
|
CreateHashedRepositories(ctx _context.Context, projectId string) ApiCreateHashedRepositoriesRequest
|
|
|
|
/*
|
|
* CreateHashedRepositoriesExecute executes the request
|
|
* @return V1AsyncTask
|
|
*/
|
|
CreateHashedRepositoriesExecute(r ApiCreateHashedRepositoriesRequest) (V1AsyncTask, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* CreateProject Method for CreateProject
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @return ApiCreateProjectRequest
|
|
*/
|
|
CreateProject(ctx _context.Context) ApiCreateProjectRequest
|
|
|
|
/*
|
|
* CreateProjectExecute executes the request
|
|
* @return V1CreateProjectResponse
|
|
*/
|
|
CreateProjectExecute(r ApiCreateProjectRequest) (V1CreateProjectResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* DeleteExternalRepository Method for DeleteExternalRepository
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @param id
|
|
* @return ApiDeleteExternalRepositoryRequest
|
|
*/
|
|
DeleteExternalRepository(ctx _context.Context, projectId string, id string) ApiDeleteExternalRepositoryRequest
|
|
|
|
/*
|
|
* DeleteExternalRepositoryExecute executes the request
|
|
* @return map[string]interface{}
|
|
*/
|
|
DeleteExternalRepositoryExecute(r ApiDeleteExternalRepositoryRequest) (map[string]interface{}, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* GetProject Method for GetProject
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param id
|
|
* @return ApiGetProjectRequest
|
|
*/
|
|
GetProject(ctx _context.Context, id string) ApiGetProjectRequest
|
|
|
|
/*
|
|
* GetProjectExecute executes the request
|
|
* @return V1GetProjectResponse
|
|
*/
|
|
GetProjectExecute(r ApiGetProjectRequest) (V1GetProjectResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* GetProjectCredentials Method for GetProjectCredentials
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiGetProjectCredentialsRequest
|
|
*/
|
|
GetProjectCredentials(ctx _context.Context, projectId string) ApiGetProjectCredentialsRequest
|
|
|
|
/*
|
|
* GetProjectCredentialsExecute executes the request
|
|
* @return V1GetProjectCredentialsResponse
|
|
*/
|
|
GetProjectCredentialsExecute(r ApiGetProjectCredentialsRequest) (V1GetProjectCredentialsResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* GetRepository Method for GetRepository
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @param id
|
|
* @return ApiGetRepositoryRequest
|
|
*/
|
|
GetRepository(ctx _context.Context, projectId string, id string) ApiGetRepositoryRequest
|
|
|
|
/*
|
|
* GetRepositoryExecute executes the request
|
|
* @return V1GetRepositoryResponse
|
|
*/
|
|
GetRepositoryExecute(r ApiGetRepositoryRequest) (V1GetRepositoryResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* ListExternalRepositories Method for ListExternalRepositories
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiListExternalRepositoriesRequest
|
|
*/
|
|
ListExternalRepositories(ctx _context.Context, projectId string) ApiListExternalRepositoriesRequest
|
|
|
|
/*
|
|
* ListExternalRepositoriesExecute executes the request
|
|
* @return V1ListExternalRepositoriesResponse
|
|
*/
|
|
ListExternalRepositoriesExecute(r ApiListExternalRepositoriesRequest) (V1ListExternalRepositoriesResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* ListProjects Method for ListProjects
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @return ApiListProjectsRequest
|
|
*/
|
|
ListProjects(ctx _context.Context) ApiListProjectsRequest
|
|
|
|
/*
|
|
* ListProjectsExecute executes the request
|
|
* @return V1ListProjectsResponse
|
|
*/
|
|
ListProjectsExecute(r ApiListProjectsRequest) (V1ListProjectsResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* ListRepositories Method for ListRepositories
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiListRepositoriesRequest
|
|
*/
|
|
ListRepositories(ctx _context.Context, projectId string) ApiListRepositoriesRequest
|
|
|
|
/*
|
|
* ListRepositoriesExecute executes the request
|
|
* @return V1ListRepositoriesResponse
|
|
*/
|
|
ListRepositoriesExecute(r ApiListRepositoriesRequest) (V1ListRepositoriesResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* LookasideFileUpload Method for LookasideFileUpload
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @return ApiLookasideFileUploadRequest
|
|
*/
|
|
LookasideFileUpload(ctx _context.Context) ApiLookasideFileUploadRequest
|
|
|
|
/*
|
|
* LookasideFileUploadExecute executes the request
|
|
* @return V1LookasideFileUploadResponse
|
|
*/
|
|
LookasideFileUploadExecute(r ApiLookasideFileUploadRequest) (V1LookasideFileUploadResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* SetProjectCredentials Method for SetProjectCredentials
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiSetProjectCredentialsRequest
|
|
*/
|
|
SetProjectCredentials(ctx _context.Context, projectId string) ApiSetProjectCredentialsRequest
|
|
|
|
/*
|
|
* SetProjectCredentialsExecute executes the request
|
|
* @return V1SetProjectCredentialsResponse
|
|
*/
|
|
SetProjectCredentialsExecute(r ApiSetProjectCredentialsRequest) (V1SetProjectCredentialsResponse, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* SyncCatalog Method for SyncCatalog
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiSyncCatalogRequest
|
|
*/
|
|
SyncCatalog(ctx _context.Context, projectId string) ApiSyncCatalogRequest
|
|
|
|
/*
|
|
* SyncCatalogExecute executes the request
|
|
* @return V1AsyncTask
|
|
*/
|
|
SyncCatalogExecute(r ApiSyncCatalogRequest) (V1AsyncTask, *_nethttp.Response, error)
|
|
|
|
/*
|
|
* UpdateProject Method for UpdateProject
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiUpdateProjectRequest
|
|
*/
|
|
UpdateProject(ctx _context.Context, projectId string) ApiUpdateProjectRequest
|
|
|
|
/*
|
|
* UpdateProjectExecute executes the request
|
|
* @return V1UpdateProjectResponse
|
|
*/
|
|
UpdateProjectExecute(r ApiUpdateProjectRequest) (V1UpdateProjectResponse, *_nethttp.Response, error)
|
|
}
|
|
|
|
// ProjectServiceApiService ProjectServiceApi service
|
|
type ProjectServiceApiService service
|
|
|
|
type ApiCreateHashedRepositoriesRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
body *InlineObject8
|
|
}
|
|
|
|
func (r ApiCreateHashedRepositoriesRequest) Body(body InlineObject8) ApiCreateHashedRepositoriesRequest {
|
|
r.body = &body
|
|
return r
|
|
}
|
|
|
|
func (r ApiCreateHashedRepositoriesRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) {
|
|
return r.ApiService.CreateHashedRepositoriesExecute(r)
|
|
}
|
|
|
|
/*
|
|
* CreateHashedRepositories Method for CreateHashedRepositories
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiCreateHashedRepositoriesRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) CreateHashedRepositories(ctx _context.Context, projectId string) ApiCreateHashedRepositoriesRequest {
|
|
return ApiCreateHashedRepositoriesRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1AsyncTask
|
|
*/
|
|
func (a *ProjectServiceApiService) CreateHashedRepositoriesExecute(r ApiCreateHashedRepositoriesRequest) (V1AsyncTask, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1AsyncTask
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.CreateHashedRepositories")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}/repositories/hashed"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
if r.body == nil {
|
|
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = r.body
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiCreateProjectRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
body *V1CreateProjectRequest
|
|
}
|
|
|
|
func (r ApiCreateProjectRequest) Body(body V1CreateProjectRequest) ApiCreateProjectRequest {
|
|
r.body = &body
|
|
return r
|
|
}
|
|
|
|
func (r ApiCreateProjectRequest) Execute() (V1CreateProjectResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.CreateProjectExecute(r)
|
|
}
|
|
|
|
/*
|
|
* CreateProject Method for CreateProject
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @return ApiCreateProjectRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) CreateProject(ctx _context.Context) ApiCreateProjectRequest {
|
|
return ApiCreateProjectRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1CreateProjectResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) CreateProjectExecute(r ApiCreateProjectRequest) (V1CreateProjectResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1CreateProjectResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.CreateProject")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
if r.body == nil {
|
|
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = r.body
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiDeleteExternalRepositoryRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
id string
|
|
}
|
|
|
|
|
|
func (r ApiDeleteExternalRepositoryRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) {
|
|
return r.ApiService.DeleteExternalRepositoryExecute(r)
|
|
}
|
|
|
|
/*
|
|
* DeleteExternalRepository Method for DeleteExternalRepository
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @param id
|
|
* @return ApiDeleteExternalRepositoryRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) DeleteExternalRepository(ctx _context.Context, projectId string, id string) ApiDeleteExternalRepositoryRequest {
|
|
return ApiDeleteExternalRepositoryRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return map[string]interface{}
|
|
*/
|
|
func (a *ProjectServiceApiService) DeleteExternalRepositoryExecute(r ApiDeleteExternalRepositoryRequest) (map[string]interface{}, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodDelete
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue map[string]interface{}
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.DeleteExternalRepository")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}/external_repositories/{id}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(r.id, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiGetProjectRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
id string
|
|
}
|
|
|
|
|
|
func (r ApiGetProjectRequest) Execute() (V1GetProjectResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.GetProjectExecute(r)
|
|
}
|
|
|
|
/*
|
|
* GetProject Method for GetProject
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param id
|
|
* @return ApiGetProjectRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) GetProject(ctx _context.Context, id string) ApiGetProjectRequest {
|
|
return ApiGetProjectRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1GetProjectResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) GetProjectExecute(r ApiGetProjectRequest) (V1GetProjectResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1GetProjectResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.GetProject")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{id}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(r.id, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiGetProjectCredentialsRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
}
|
|
|
|
|
|
func (r ApiGetProjectCredentialsRequest) Execute() (V1GetProjectCredentialsResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.GetProjectCredentialsExecute(r)
|
|
}
|
|
|
|
/*
|
|
* GetProjectCredentials Method for GetProjectCredentials
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiGetProjectCredentialsRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) GetProjectCredentials(ctx _context.Context, projectId string) ApiGetProjectCredentialsRequest {
|
|
return ApiGetProjectCredentialsRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1GetProjectCredentialsResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) GetProjectCredentialsExecute(r ApiGetProjectCredentialsRequest) (V1GetProjectCredentialsResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1GetProjectCredentialsResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.GetProjectCredentials")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}/credentials"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiGetRepositoryRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
id string
|
|
}
|
|
|
|
|
|
func (r ApiGetRepositoryRequest) Execute() (V1GetRepositoryResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.GetRepositoryExecute(r)
|
|
}
|
|
|
|
/*
|
|
* GetRepository Method for GetRepository
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @param id
|
|
* @return ApiGetRepositoryRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) GetRepository(ctx _context.Context, projectId string, id string) ApiGetRepositoryRequest {
|
|
return ApiGetRepositoryRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1GetRepositoryResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) GetRepositoryExecute(r ApiGetRepositoryRequest) (V1GetRepositoryResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1GetRepositoryResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.GetRepository")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}/repositories/{id}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(r.id, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiListExternalRepositoriesRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
}
|
|
|
|
|
|
func (r ApiListExternalRepositoriesRequest) Execute() (V1ListExternalRepositoriesResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.ListExternalRepositoriesExecute(r)
|
|
}
|
|
|
|
/*
|
|
* ListExternalRepositories Method for ListExternalRepositories
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiListExternalRepositoriesRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) ListExternalRepositories(ctx _context.Context, projectId string) ApiListExternalRepositoriesRequest {
|
|
return ApiListExternalRepositoriesRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1ListExternalRepositoriesResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) ListExternalRepositoriesExecute(r ApiListExternalRepositoriesRequest) (V1ListExternalRepositoriesResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1ListExternalRepositoriesResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.ListExternalRepositories")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}/external_repositories"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiListProjectsRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
page *string
|
|
limit *int32
|
|
}
|
|
|
|
func (r ApiListProjectsRequest) Page(page string) ApiListProjectsRequest {
|
|
r.page = &page
|
|
return r
|
|
}
|
|
func (r ApiListProjectsRequest) Limit(limit int32) ApiListProjectsRequest {
|
|
r.limit = &limit
|
|
return r
|
|
}
|
|
|
|
func (r ApiListProjectsRequest) Execute() (V1ListProjectsResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.ListProjectsExecute(r)
|
|
}
|
|
|
|
/*
|
|
* ListProjects Method for ListProjects
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @return ApiListProjectsRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) ListProjects(ctx _context.Context) ApiListProjectsRequest {
|
|
return ApiListProjectsRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1ListProjectsResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) ListProjectsExecute(r ApiListProjectsRequest) (V1ListProjectsResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1ListProjectsResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.ListProjects")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
|
|
if r.page != nil {
|
|
localVarQueryParams.Add("page", parameterToString(*r.page, ""))
|
|
}
|
|
if r.limit != nil {
|
|
localVarQueryParams.Add("limit", parameterToString(*r.limit, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiListRepositoriesRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
}
|
|
|
|
|
|
func (r ApiListRepositoriesRequest) Execute() (V1ListRepositoriesResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.ListRepositoriesExecute(r)
|
|
}
|
|
|
|
/*
|
|
* ListRepositories Method for ListRepositories
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiListRepositoriesRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) ListRepositories(ctx _context.Context, projectId string) ApiListRepositoriesRequest {
|
|
return ApiListRepositoriesRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1ListRepositoriesResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) ListRepositoriesExecute(r ApiListRepositoriesRequest) (V1ListRepositoriesResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1ListRepositoriesResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.ListRepositories")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}/repositories"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiLookasideFileUploadRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
body *V1LookasideFileUploadRequest
|
|
}
|
|
|
|
func (r ApiLookasideFileUploadRequest) Body(body V1LookasideFileUploadRequest) ApiLookasideFileUploadRequest {
|
|
r.body = &body
|
|
return r
|
|
}
|
|
|
|
func (r ApiLookasideFileUploadRequest) Execute() (V1LookasideFileUploadResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.LookasideFileUploadExecute(r)
|
|
}
|
|
|
|
/*
|
|
* LookasideFileUpload Method for LookasideFileUpload
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @return ApiLookasideFileUploadRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) LookasideFileUpload(ctx _context.Context) ApiLookasideFileUploadRequest {
|
|
return ApiLookasideFileUploadRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1LookasideFileUploadResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) LookasideFileUploadExecute(r ApiLookasideFileUploadRequest) (V1LookasideFileUploadResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1LookasideFileUploadResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.LookasideFileUpload")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/lookaside"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
if r.body == nil {
|
|
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = r.body
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiSetProjectCredentialsRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
body *InlineObject6
|
|
}
|
|
|
|
func (r ApiSetProjectCredentialsRequest) Body(body InlineObject6) ApiSetProjectCredentialsRequest {
|
|
r.body = &body
|
|
return r
|
|
}
|
|
|
|
func (r ApiSetProjectCredentialsRequest) Execute() (V1SetProjectCredentialsResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.SetProjectCredentialsExecute(r)
|
|
}
|
|
|
|
/*
|
|
* SetProjectCredentials Method for SetProjectCredentials
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiSetProjectCredentialsRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) SetProjectCredentials(ctx _context.Context, projectId string) ApiSetProjectCredentialsRequest {
|
|
return ApiSetProjectCredentialsRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1SetProjectCredentialsResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) SetProjectCredentialsExecute(r ApiSetProjectCredentialsRequest) (V1SetProjectCredentialsResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1SetProjectCredentialsResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.SetProjectCredentials")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}/credentials"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
if r.body == nil {
|
|
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = r.body
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiSyncCatalogRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
body *InlineObject5
|
|
}
|
|
|
|
func (r ApiSyncCatalogRequest) Body(body InlineObject5) ApiSyncCatalogRequest {
|
|
r.body = &body
|
|
return r
|
|
}
|
|
|
|
func (r ApiSyncCatalogRequest) Execute() (V1AsyncTask, *_nethttp.Response, error) {
|
|
return r.ApiService.SyncCatalogExecute(r)
|
|
}
|
|
|
|
/*
|
|
* SyncCatalog Method for SyncCatalog
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiSyncCatalogRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) SyncCatalog(ctx _context.Context, projectId string) ApiSyncCatalogRequest {
|
|
return ApiSyncCatalogRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1AsyncTask
|
|
*/
|
|
func (a *ProjectServiceApiService) SyncCatalogExecute(r ApiSyncCatalogRequest) (V1AsyncTask, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1AsyncTask
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.SyncCatalog")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}/catalogsync"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
if r.body == nil {
|
|
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = r.body
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|
|
|
|
type ApiUpdateProjectRequest struct {
|
|
ctx _context.Context
|
|
ApiService ProjectServiceApi
|
|
projectId string
|
|
body *InlineObject
|
|
}
|
|
|
|
func (r ApiUpdateProjectRequest) Body(body InlineObject) ApiUpdateProjectRequest {
|
|
r.body = &body
|
|
return r
|
|
}
|
|
|
|
func (r ApiUpdateProjectRequest) Execute() (V1UpdateProjectResponse, *_nethttp.Response, error) {
|
|
return r.ApiService.UpdateProjectExecute(r)
|
|
}
|
|
|
|
/*
|
|
* UpdateProject Method for UpdateProject
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
* @param projectId
|
|
* @return ApiUpdateProjectRequest
|
|
*/
|
|
func (a *ProjectServiceApiService) UpdateProject(ctx _context.Context, projectId string) ApiUpdateProjectRequest {
|
|
return ApiUpdateProjectRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
projectId: projectId,
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Execute executes the request
|
|
* @return V1UpdateProjectResponse
|
|
*/
|
|
func (a *ProjectServiceApiService) UpdateProjectExecute(r ApiUpdateProjectRequest) (V1UpdateProjectResponse, *_nethttp.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = _nethttp.MethodPut
|
|
localVarPostBody interface{}
|
|
localVarFormFileName string
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
localVarReturnValue V1UpdateProjectResponse
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectServiceApiService.UpdateProject")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/projects/{projectId}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", _neturl.PathEscape(parameterToString(r.projectId, "")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := _neturl.Values{}
|
|
localVarFormParams := _neturl.Values{}
|
|
if r.body == nil {
|
|
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
}
|
|
|
|
// to determine the Content-Type header
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
|
|
|
// set Content-Type header
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
if localVarHTTPContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = r.body
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v RpcStatus
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.model = v
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr := GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: err.Error(),
|
|
}
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
}
|