Categorygithub.com/lab5e/go-spanuserapi/v4
package
4.5.0-beta
Repository: https://github.com/lab5e/go-spanuserapi.git
Documentation: pkg.go.dev

# README

Go API client for spanuserapi

API for sessions, teams and API tokens

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: [version] [name]
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://lab5e.com

Installation

Install the following dependencies:

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

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

import spanuserapi "github.com/lab5e/go-spanuserapi"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), spanuserapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), spanuserapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), spanuserapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), spanuserapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.lab5e.com

ClassMethodHTTP requestDescription
OrgsApiAddAPITokenPost /dejavu/v1/orgs/{orgId}/teams/{teamId}/apitokensAdd API token to team
OrgsApiAddTeamMemberPost /dejavu/v1/orgs/{orgId}/teams/{teamId}/membersAdd a team member
OrgsApiCreateOrgPost /dejavu/v1/orgsCreate new organisation
OrgsApiCreateOrgInvitesPost /dejavu/v1/orgs/{orgId}/invitesInvite members into org
OrgsApiCreateOrgTeamPost /dejavu/v1/orgs/{orgId}/teamsCreate a team
OrgsApiDeleteOrgDelete /dejavu/v1/orgs/{orgId}Delete organisation
OrgsApiDeleteOrgTeamDelete /dejavu/v1/orgs/{orgId}/teams/{teamId}Delete a team
OrgsApiGetAPITokenGet /dejavu/v1/orgs/{orgId}/teams/{teamId}/apitokens/{tokenId}Retrieve API token
OrgsApiGetOrgGet /dejavu/v1/orgs/{orgId}Organisation details
OrgsApiGetOrgTeamGet /dejavu/v1/orgs/{orgId}/teams/{teamId}Retrieve team information
OrgsApiHandleInvitePatch /dejavu/v1/orgs/invites/{inviteId}Respond to invite
OrgsApiListAPITokensGet /dejavu/v1/orgs/{orgId}/teams/apitokensList API tokens for teams in organisation
OrgsApiListInvitesPost /dejavu/v1/orgs/invitesList invites
OrgsApiListOrgMembersGet /dejavu/v1/orgs/{orgId}/membersList members of organisation
OrgsApiListOrgTeamsGet /dejavu/v1/orgs/{orgId}/teamsList teams in org
OrgsApiListOrgsGet /dejavu/v1/orgsList organisations
OrgsApiRemoveAPITokenDelete /dejavu/v1/orgs/{orgId}/teams/{teamId}/apitokens/{tokenId}Remove API token from team
OrgsApiRemoveOrgMemberDelete /dejavu/v1/orgs/{orgId}/members/{memberId}Remove member from organisation
OrgsApiRemoveTeamMemberDelete /dejavu/v1/orgs/{orgId}/teams/{teamId}/members/{memberId}Remove a member from a team
OrgsApiUpdateAPITokenPatch /dejavu/v1/orgs/{orgId}/teams/{teamId}/apitokens/{tokenId}Update API token
OrgsApiUpdateOrgPatch /dejavu/v1/orgs/{orgId}Update organisation
OrgsApiUpdateOrgMemberRolePatch /dejavu/v1/orgs/{orgId}/members/{memberId}Update org member role
OrgsApiUpdateOrgTeamPatch /dejavu/v1/orgs/{orgId}/teams/{teamId}Update a team
OrgsApiUpdateTeamMemberPatch /dejavu/v1/orgs/{orgId}/teams/{teamId}/membersChange membership role for a team member
ProfileApiNewMFATokenPost /dejavu/v1/mfa/newAssign MFA token
ProfileApiProfileGet /dejavu/v1/profileRetrieve profile
ProfileApiRemoveMFATokenPost /dejavu/v1/mfa/removeRemove MFA token
ProfileApiUpdatePasswordPost /dejavu/v1/profile/passwordChange password
ProfileApiUpdateProfilePost /dejavu/v1/profileUpdate profile
ProfileApiVerifyNewMFATokenPost /dejavu/v1/mfa/verifyVerify MFA token
ProfileApiVerifyPhonePost /dejavu/v1/phone/verifyVerify phone number
SessionApiListSessionsPost /dejavu/v1/sessionsList sessions
SessionApiLoginPost /dejavu/v1/loginSign in to the service
SessionApiLogoutPost /dejavu/v1/logoutSign out
SessionApiRecoverPasswordPost /dejavu/v1/recoverRecover/reset password
SignupApiEndUserLicenseAgreementGet /dejavu/v1/eulaEULA text
SignupApiGetGithubProfileGet /dejavu/v1/ghprofile/{githubToken}Retrieve GitHub profile
SignupApiSignupPost /dejavu/v1/signupSign up new user
SignupApiUpdateGithubProfilePost /dejavu/v1/ghprofile/{githubToken}Update GitHub profile
SignupApiVerifyEmailPost /dejavu/v1/verifyemailVerify email
SignupApiVerifyGithubProfilePost /dejavu/v1/ghprofile/{emailToken}/verifyVerify GitHub profile

Documentation For Models

Documentation For Authorization

APIToken

  • Type: API key
  • API key parameter name: X-API-Token
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: X-API-Token and passed in as the auth context for each request.

bearer

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]