package
0.0.0-20241107225852-559ac656df31
Repository: https://github.com/traptitech/anke-to.git
Documentation: pkg.go.dev

# README

Go API client for openapi

anke-to API

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0-oas3
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://github.com/traPtitech/anke-to

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./openapi"

Documentation for API Endpoints

All URIs are relative to https://anke-to.trap.jp/api

ClassMethodHTTP requestDescription
GroupApiGetGroupsGet /groups未実装
QuestionApiDeleteQuestionDelete /questions/{questionID}
QuestionApiPatchQuestionPatch /questions/{questionID}
QuestionApiPostQuestionPost /questions
QuestionnaireApiDelteQuestionnaireDelete /questionnaires/{questionnaireID}
QuestionnaireApiGetQuestionnaireGet /questionnaires/{questionnaireID}
QuestionnaireApiGetQuestionnairesGet /questionnaires
QuestionnaireApiGetQuestionsGet /questionnaires/{questionnaireID}/questions
QuestionnaireApiPatchQuestionnairePatch /questionnaires/{questionnaireID}
QuestionnaireApiPostQuestionnairePost /questionnaires
ResponseApiDeleteResponseDelete /responses/{responseID}
ResponseApiGetResponsesGet /responses/{responseID}
ResponseApiPatchResponsePatch /responses/{responseID}
ResponseApiPostResponsePost /responses
ResultApiGetResultsGet /results/{questionnaireID}
UserApiGetMeGet /users/me
UserApiGetMyAdministratesGet /users/me/administrates
UserApiGetMyResponsesGet /users/me/responses
UserApiGetMyTargetedGet /users/me/targeted
UserApiGetResponsesToQuestionnaireGet /users/me/responses/{questionnaireID}
UserApiGetUsersGet /users未実装

Documentation For Models

Documentation For Authorization

application

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
  • write: allows modifying resources
  • read: allows reading resources

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Author