Generated go sdk for the vikunja api
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.0 KiB

2 years ago
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
2 years ago
"encoding/json"
"golang.org/x/net/context"
2 years ago
"io/ioutil"
"net/http"
2 years ago
"net/url"
2 years ago
"strings"
)
// Linger please
var (
_ context.Context
)
type ServiceApiService service
/* ServiceApiService Info
2 years ago
Returns the version, frontendurl, motd and various settings of Vikunja
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1VikunjaInfos*/
func (a *ServiceApiService) InfoGet(ctx context.Context) (V1VikunjaInfos, *http.Response, error) {
2 years ago
var (
localVarHttpMethod = strings.ToUpper("Get")
2 years ago
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1VikunjaInfos
2 years ago
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/info"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
2 years ago
localVarHttpContentTypes := []string{}
2 years ago
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
2 years ago
}
2 years ago
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}