| |
|
| |
|
| | package graphql
|
| |
|
| | import (
|
| | "context"
|
| |
|
| | "github.com/Khan/genqlient/graphql"
|
| | )
|
| |
|
| |
|
| | type CreateAPIKeyCreateLLMAPIKey struct {
|
| | Key string `json:"key"`
|
| | Name string `json:"name"`
|
| | Scopes []string `json:"scopes"`
|
| | }
|
| |
|
| |
|
| | func (v *CreateAPIKeyCreateLLMAPIKey) GetKey() string { return v.Key }
|
| |
|
| |
|
| | func (v *CreateAPIKeyCreateLLMAPIKey) GetName() string { return v.Name }
|
| |
|
| |
|
| | func (v *CreateAPIKeyCreateLLMAPIKey) GetScopes() []string { return v.Scopes }
|
| |
|
| |
|
| | type CreateAPIKeyResponse struct {
|
| | CreateLLMAPIKey *CreateAPIKeyCreateLLMAPIKey `json:"createLLMAPIKey"`
|
| | }
|
| |
|
| |
|
| | func (v *CreateAPIKeyResponse) GetCreateLLMAPIKey() *CreateAPIKeyCreateLLMAPIKey {
|
| | return v.CreateLLMAPIKey
|
| | }
|
| |
|
| |
|
| | type __CreateAPIKeyInput struct {
|
| | Name string `json:"name"`
|
| | }
|
| |
|
| |
|
| | func (v *__CreateAPIKeyInput) GetName() string { return v.Name }
|
| |
|
| |
|
| | const CreateAPIKey_Operation = `
|
| | mutation CreateAPIKey ($name: String!) {
|
| | createLLMAPIKey(name: $name) {
|
| | key
|
| | name
|
| | scopes
|
| | }
|
| | }
|
| | `
|
| |
|
| | func CreateAPIKey(
|
| | ctx_ context.Context,
|
| | client_ graphql.Client,
|
| | name string,
|
| | ) (data_ *CreateAPIKeyResponse, err_ error) {
|
| | req_ := &graphql.Request{
|
| | OpName: "CreateAPIKey",
|
| | Query: CreateAPIKey_Operation,
|
| | Variables: &__CreateAPIKeyInput{
|
| | Name: name,
|
| | },
|
| | }
|
| |
|
| | data_ = &CreateAPIKeyResponse{}
|
| | resp_ := &graphql.Response{Data: data_}
|
| |
|
| | err_ = client_.MakeRequest(
|
| | ctx_,
|
| | req_,
|
| | resp_,
|
| | )
|
| |
|
| | return data_, err_
|
| | }
|
| |
|