llzai's picture
Upload 1793 files
9853396 verified
// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
package graphql
import (
"context"
"github.com/Khan/genqlient/graphql"
)
// CreateAPIKeyCreateLLMAPIKey includes the requested fields of the GraphQL type APIKey.
type CreateAPIKeyCreateLLMAPIKey struct {
Key string `json:"key"`
Name string `json:"name"`
Scopes []string `json:"scopes"`
}
// GetKey returns CreateAPIKeyCreateLLMAPIKey.Key, and is useful for accessing the field via an interface.
func (v *CreateAPIKeyCreateLLMAPIKey) GetKey() string { return v.Key }
// GetName returns CreateAPIKeyCreateLLMAPIKey.Name, and is useful for accessing the field via an interface.
func (v *CreateAPIKeyCreateLLMAPIKey) GetName() string { return v.Name }
// GetScopes returns CreateAPIKeyCreateLLMAPIKey.Scopes, and is useful for accessing the field via an interface.
func (v *CreateAPIKeyCreateLLMAPIKey) GetScopes() []string { return v.Scopes }
// CreateAPIKeyResponse is returned by CreateAPIKey on success.
type CreateAPIKeyResponse struct {
CreateLLMAPIKey *CreateAPIKeyCreateLLMAPIKey `json:"createLLMAPIKey"`
}
// GetCreateLLMAPIKey returns CreateAPIKeyResponse.CreateLLMAPIKey, and is useful for accessing the field via an interface.
func (v *CreateAPIKeyResponse) GetCreateLLMAPIKey() *CreateAPIKeyCreateLLMAPIKey {
return v.CreateLLMAPIKey
}
// __CreateAPIKeyInput is used internally by genqlient
type __CreateAPIKeyInput struct {
Name string `json:"name"`
}
// GetName returns __CreateAPIKeyInput.Name, and is useful for accessing the field via an interface.
func (v *__CreateAPIKeyInput) GetName() string { return v.Name }
// The mutation executed by CreateAPIKey.
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_
}