GoodMem
ReferenceClient SDKsGo SDK

API Keys API

API Keys API documentation for Go SDK

All URIs are relative to http://localhost:8080

MethodHTTP requestDescription
CreateApiKeyPost /v1/apikeysCreate a new API key
DeleteApiKeyDelete /v1/apikeys/{id}Delete an API key
ListApiKeysGet /v1/apikeysList API keys
UpdateApiKeyPut /v1/apikeys/{id}Update an API key

CreateApiKey

CreateApiKeyResponse CreateApiKey(ctx).CreateApiKeyRequest(createApiKeyRequest).Execute()

Create a new API key

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	createApiKeyRequest := *goodmem_client.NewCreateApiKeyRequest() // CreateApiKeyRequest | API key configuration

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.APIKeysAPI.CreateApiKey(context.Background()).CreateApiKeyRequest(createApiKeyRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `APIKeysAPI.CreateApiKey``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateApiKey`: CreateApiKeyResponse
	fmt.Fprintf(os.Stdout, "Response from `APIKeysAPI.CreateApiKey`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateApiKeyRequest struct via the builder pattern

NameTypeDescriptionNotes
createApiKeyRequestCreateApiKeyRequestAPI key configuration

Return type

CreateApiKeyResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

DeleteApiKey

DeleteApiKey(ctx, id).Execute()

Delete an API key

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the API key to delete

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	r, err := apiClient.APIKeysAPI.DeleteApiKey(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `APIKeysAPI.DeleteApiKey``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the API key to delete

Other Parameters

Other parameters are passed through a pointer to a apiDeleteApiKeyRequest struct via the builder pattern

NameTypeDescriptionNotes

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

ListApiKeys

ListApiKeysResponse ListApiKeys(ctx).Execute()

List API keys

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.APIKeysAPI.ListApiKeys(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `APIKeysAPI.ListApiKeys``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListApiKeys`: ListApiKeysResponse
	fmt.Fprintf(os.Stdout, "Response from `APIKeysAPI.ListApiKeys`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListApiKeysRequest struct via the builder pattern

Return type

ListApiKeysResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

UpdateApiKey

ApiKeyResponse UpdateApiKey(ctx, id).UpdateApiKeyRequest(updateApiKeyRequest).Execute()

Update an API key

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the API key to update
	updateApiKeyRequest := *goodmem_client.NewUpdateApiKeyRequest() // UpdateApiKeyRequest | API key update details

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.APIKeysAPI.UpdateApiKey(context.Background(), id).UpdateApiKeyRequest(updateApiKeyRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `APIKeysAPI.UpdateApiKey``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateApiKey`: ApiKeyResponse
	fmt.Fprintf(os.Stdout, "Response from `APIKeysAPI.UpdateApiKey`: %v\n", resp)
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the API key to update

Other Parameters

Other parameters are passed through a pointer to a apiUpdateApiKeyRequest struct via the builder pattern

NameTypeDescriptionNotes

updateApiKeyRequest | UpdateApiKeyRequest | API key update details |

Return type

ApiKeyResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK