diff --git a/autocomplete/fish_autocomplete b/autocomplete/fish_autocomplete index dae7573de..7683e067d 100644 --- a/autocomplete/fish_autocomplete +++ b/autocomplete/fish_autocomplete @@ -20,6 +20,7 @@ complete -c lk -n '__fish_lk_no_subcommand' -f -l curl -d 'Print curl commands f complete -c lk -n '__fish_lk_no_subcommand' -f -l verbose complete -c lk -n '__fish_lk_no_subcommand' -f -l yes -s y -d 'Assume yes for confirmations; fail or use default for other prompts (use in CI/non-interactive)' complete -c lk -n '__fish_lk_no_subcommand' -f -l quiet -s q -s silent -d 'Suppress informational output to stderr (warnings and errors still print)' +complete -c lk -n '__fish_lk_no_subcommand' -f -l experimental-auth -d 'EXPERIMENTAL: use user-based (session) auth against the LiveKit Public API instead of API-key auth. Most commands are not yet supported under this mode.' complete -c lk -n '__fish_lk_no_subcommand' -f -l help -s h -d 'show help' complete -c lk -n '__fish_lk_no_subcommand' -f -l version -s v -d 'print the version' complete -c lk -n '__fish_lk_no_subcommand' -xa '(lk --generate-shell-completion 2>/dev/null)' diff --git a/cmd/lk/app.go b/cmd/lk/app.go index 957f884b2..8c6c5122d 100644 --- a/cmd/lk/app.go +++ b/cmd/lk/app.go @@ -1,4 +1,4 @@ -// Copyright 2024 LiveKit, Inc. +// Copyright 2024-2026 LiveKit, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -133,6 +133,9 @@ func requireProject(ctx context.Context, cmd *cli.Command) (context.Context, err } func requireProjectWithOpts(ctx context.Context, cmd *cli.Command, opts ...loadOption) (context.Context, error) { + if err := experimentalAuthGate(cmd); err != nil { + return ctx, err + } if project != nil { // already resolved (and announced) earlier in this command return ctx, nil diff --git a/cmd/lk/experimental_auth.go b/cmd/lk/experimental_auth.go new file mode 100644 index 000000000..9f15d66c6 --- /dev/null +++ b/cmd/lk/experimental_auth.go @@ -0,0 +1,92 @@ +// Copyright 2026 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "errors" + "fmt" + + "github.com/urfave/cli/v3" + + "github.com/livekit/livekit-cli/v2/pkg/config" + "github.com/livekit/livekit-cli/v2/pkg/public" +) + +// experimentalAuthEnabled reports whether the user opted into user-based +// (session) auth via the global --experimental-auth flag. +func experimentalAuthEnabled(cmd *cli.Command) bool { + return cmd.Bool("experimental-auth") +} + +// experimentalAuthGate refuses a command that only supports API-key auth when +// the user requested experimental user-based auth. User auth routes through the +// Public API, which does not yet implement most operations; rather than +// silently fall back to API-key auth — a different security model than the user +// asked for — we fail clearly. Command paths that DO support user auth branch on +// experimentalAuthEnabled before reaching this gate. +func experimentalAuthGate(cmd *cli.Command) error { + if experimentalAuthEnabled(cmd) { + return errors.New("this command is not yet available under --experimental-auth (user-based auth); re-run without it to use API-key authentication") + } + return nil +} + +// requireUserSession loads the CLI config and resolves the default user with a +// valid (unexpired) session, for commands running under --experimental-auth. +// The returned *CLIConfig is the same instance the user was read from, so +// callers may cache data on it (e.g. via SetUserProjects) and persist. +func requireUserSession(cmd *cli.Command) (*config.CLIConfig, *config.UserConfig, error) { + conf, err := config.LoadOrCreate() + if err != nil { + return nil, nil, err + } + if conf.DefaultUser == "" { + return nil, nil, errors.New("no user is signed in (run `lk cloud auth` to sign in)") + } + user := conf.GetUser(conf.DefaultUser) + if user == nil { + return nil, nil, fmt.Errorf("default user %q not found in config", conf.DefaultUser) + } + if !user.SessionValid() { + return nil, nil, fmt.Errorf("session for %s has expired (run `lk cloud auth` to sign in again)", userLabel(user)) + } + return conf, user, nil +} + +// newCloudAPIClient builds a Public API client authenticated as the default +// user, honoring --experimental-api-url. +func newCloudAPIClient(cmd *cli.Command) (*public.Client, *config.CLIConfig, *config.UserConfig, error) { + conf, user, err := requireUserSession(cmd) + if err != nil { + return nil, nil, nil, err + } + client, err := public.New(experimentalAPIURL, user.SessionToken) + if err != nil { + return nil, nil, nil, err + } + return client, conf, user, nil +} + +// userLabel is a human-friendly identifier for a user, preferring email. +func userLabel(u *config.UserConfig) string { + switch { + case u.Email != "": + return u.Email + case u.Name != "": + return u.Name + default: + return u.Id + } +} diff --git a/cmd/lk/project.go b/cmd/lk/project.go index d1c753f3f..ec08d29cf 100644 --- a/cmd/lk/project.go +++ b/cmd/lk/project.go @@ -1,4 +1,4 @@ -// Copyright 2022-2024 LiveKit, Inc. +// Copyright 2022-2026 LiveKit, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package main import ( "context" "errors" + "fmt" "net/url" "regexp" @@ -26,6 +27,7 @@ import ( "github.com/urfave/cli/v3" "github.com/livekit/livekit-cli/v2/pkg/config" + "github.com/livekit/livekit-cli/v2/pkg/public" "github.com/livekit/livekit-cli/v2/pkg/util" ) @@ -269,6 +271,10 @@ func addProject(ctx context.Context, cmd *cli.Command) error { } func listProjects(ctx context.Context, cmd *cli.Command) error { + if experimentalAuthEnabled(cmd) { + return listUserProjects(ctx, cmd) + } + if len(cliConfig.Projects) == 0 { out.Status("No projects configured, use `lk cloud auth` to authenticate a new project.") return nil @@ -308,6 +314,45 @@ func listProjects(ctx context.Context, cmd *cli.Command) error { return nil } +// listUserProjects lists the projects accessible to the signed-in user via the +// Public API (user-based auth). Invoked by `lk project list --experimental-auth`. +// +// NOTE: it fetches live on each call. The per-user project cache +// (config.UserConfig.Projects) exists for project *resolution* by scoped +// commands and is populated there; a read-only list stays quiet and does not +// persist config. +func listUserProjects(ctx context.Context, cmd *cli.Command) error { + client, _, _, err := newCloudAPIClient(cmd) + if err != nil { + return err + } + + projects, err := client.ListProjects(ctx) + if err != nil { + if public.IsUnauthenticated(err) { + return fmt.Errorf("%w (run `lk cloud auth` to sign in again)", err) + } + return err + } + + if cmd.Bool("json") { + util.PrintJSON(projects) + return nil + } + + if len(projects) == 0 { + out.Status("No projects found for this account.") + return nil + } + + table := util.CreateTable().Headers("Project ID") + for _, p := range projects { + table.Row(p.ID) + } + out.Result(table) + return nil +} + func removeProject(ctx context.Context, cmd *cli.Command) error { if cmd.NArg() == 0 { _ = cli.ShowSubcommandHelp(cmd) diff --git a/cmd/lk/utils.go b/cmd/lk/utils.go index 54e8a9627..9b8b2eb71 100644 --- a/cmd/lk/utils.go +++ b/cmd/lk/utils.go @@ -1,4 +1,4 @@ -// Copyright 2021-2024 LiveKit, Inc. +// Copyright 2021-2026 LiveKit, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -38,14 +38,20 @@ import ( const ( cloudAPIServerURL = "https://cloud-api.livekit.io" cloudDashboardURL = "https://cloud.livekit.io" + // publicAPIBaseURL is the production base URL of the user-authenticated + // LiveKit Public API (the OpenAPI REST service). Used only under + // --experimental-auth; override with --experimental-api-url for dev + // (e.g. http://localhost:8000/v1). + publicAPIBaseURL = "https://api.livekit.cloud/v1" ) var ( - printCurl bool - workingDir string = "." - tomlFilename string = config.LiveKitTOMLFile - serverURL string = cloudAPIServerURL - dashboardURL string = cloudDashboardURL + printCurl bool + workingDir string = "." + tomlFilename string = config.LiveKitTOMLFile + serverURL string = cloudAPIServerURL + dashboardURL string = cloudDashboardURL + experimentalAPIURL string = publicAPIBaseURL roomFlag = &TemplateStringFlag{ Name: "room", @@ -152,6 +158,18 @@ var ( Usage: "Assume yes for confirmations; fail or use default for other prompts (use in CI/non-interactive)", }, quietFlag, + &cli.BoolFlag{ + Name: "experimental-auth", + Usage: "EXPERIMENTAL: use user-based (session) auth against the LiveKit Public API instead of API-key auth. Most commands are not yet supported under this mode.", + }, + &cli.StringFlag{ + Name: "experimental-api-url", + Usage: "Base `URL` of the LiveKit Public API used with --experimental-auth", + Value: publicAPIBaseURL, + Destination: &experimentalAPIURL, + Sources: cli.EnvVars("LIVEKIT_API_URL"), + Hidden: true, + }, &cli.StringFlag{ Name: "server-url", Value: cloudAPIServerURL, @@ -424,6 +442,9 @@ func resolveProject(c *cli.Command, p loadParams) (*resolvedProject, error) { // the package-level `project` (app/agent) go through requireProject instead, which layers // interactive selection on top of the same resolver before announcing. func loadProjectDetails(c *cli.Command, opts ...loadOption) (*config.ProjectConfig, error) { + if err := experimentalAuthGate(c); err != nil { + return nil, err + } p := loadParams{requireURL: true} for _, opt := range opts { opt(&p) diff --git a/go.mod b/go.mod index e8a2ff019..a36bbd555 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ require ( github.com/mattn/go-isatty v0.0.22 github.com/moby/patternmatcher v0.6.1 github.com/modelcontextprotocol/go-sdk v1.6.1 + github.com/oapi-codegen/runtime v1.4.2 github.com/pelletier/go-toml v1.9.5 github.com/pion/rtcp v1.2.16 github.com/pion/rtp v1.10.2 @@ -33,7 +34,7 @@ require ( github.com/twitchtv/twirp v8.1.3+incompatible github.com/urfave/cli/v3 v3.9.0 go.uber.org/atomic v1.11.0 - golang.org/x/sync v0.20.0 + golang.org/x/sync v0.21.0 golang.org/x/time v0.15.0 google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af gopkg.in/yaml.v3 v3.0.1 @@ -62,6 +63,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/alecthomas/chroma/v2 v2.23.1 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/aws/aws-sdk-go-v2 v1.41.7 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect github.com/aws/aws-sdk-go-v2/config v1.32.17 // indirect @@ -113,13 +115,14 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dennwc/iters v1.2.2 // indirect github.com/distribution/reference v0.6.0 // indirect - github.com/dlclark/regexp2 v1.11.5 // indirect + github.com/dlclark/regexp2 v1.12.0 // indirect github.com/docker/cli v29.4.3+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.5 // indirect github.com/docker/go-connections v0.7.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dominikbraun/graph v0.23.0 // indirect + github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/elliotchance/orderedmap/v3 v3.1.0 // indirect github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect @@ -129,8 +132,11 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/gammazero/deque v1.2.1 // indirect + github.com/getkin/kin-openapi v0.135.0 // indirect github.com/go-jose/go-jose/v4 v4.1.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/jsonpointer v0.22.5 // indirect + github.com/go-openapi/swag/jsonname v0.25.5 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-task/template v0.2.0 // indirect github.com/gofrs/flock v0.13.0 // indirect @@ -154,6 +160,7 @@ require ( github.com/hashicorp/go-version v1.9.0 // indirect github.com/in-toto/attestation v1.1.2 // indirect github.com/in-toto/in-toto-golang v0.11.0 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/jxskiss/base62 v1.1.0 // indirect github.com/klauspost/compress v1.18.6 // indirect github.com/klauspost/cpuid/v2 v2.3.0 // indirect @@ -164,6 +171,7 @@ require ( github.com/livekit/psrpc v0.7.2 // indirect github.com/lucasb-eyer/go-colorful v1.4.0 // indirect github.com/magefile/mage v1.17.2 // indirect + github.com/mailru/easyjson v0.9.1 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.23 // indirect @@ -174,6 +182,7 @@ require ( github.com/moby/locker v1.0.1 // indirect github.com/moby/sys/signal v0.7.1 // indirect github.com/moby/term v0.5.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/morikuni/aec v1.1.0 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect @@ -182,8 +191,12 @@ require ( github.com/nats-io/nats.go v1.52.0 // indirect github.com/nats-io/nkeys v0.4.16 // indirect github.com/nats-io/nuid v1.0.1 // indirect + github.com/oapi-codegen/oapi-codegen/v2 v2.7.1 // indirect + github.com/oasdiff/yaml v0.0.9 // indirect + github.com/oasdiff/yaml3 v0.0.9 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pierrec/lz4/v4 v4.1.26 // indirect github.com/pion/datachannel v1.6.0 // indirect github.com/pion/dtls/v3 v3.1.4 // indirect @@ -210,11 +223,13 @@ require ( github.com/rivo/uniseg v0.4.7 // indirect github.com/sajari/fuzzy v1.0.0 // indirect github.com/secure-systems-lab/go-securesystemslib v0.10.0 // indirect - github.com/segmentio/asm v1.1.3 // indirect + github.com/segmentio/asm v1.2.1 // indirect github.com/segmentio/encoding v0.5.4 // indirect github.com/sergi/go-diff v1.4.0 // indirect github.com/shibumi/go-pathspec v1.3.0 // indirect github.com/sirupsen/logrus v1.9.4 // indirect + github.com/speakeasy-api/jsonpath v0.6.3 // indirect + github.com/speakeasy-api/openapi v1.19.2 // indirect github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect github.com/stretchr/objx v0.5.3 // indirect github.com/tonistiigi/fsutil v0.0.0-20251211185533-a2aa163d723f // indirect @@ -225,7 +240,9 @@ require ( github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect github.com/ulikunitz/xz v0.5.15 // indirect github.com/vbatts/tar-split v0.12.2 // indirect + github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect github.com/wlynxg/anet v0.0.5 // indirect + github.com/woodsbury/decimal128 v1.4.0 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect @@ -246,13 +263,15 @@ require ( go.uber.org/zap v1.28.0 // indirect go.uber.org/zap/exp v0.3.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.52.0 // indirect + golang.org/x/crypto v0.53.0 // indirect golang.org/x/exp v0.0.0-20260603202125-055de637280b // indirect - golang.org/x/net v0.55.0 // indirect + golang.org/x/mod v0.37.0 // indirect + golang.org/x/net v0.56.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/term v0.43.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/term v0.44.0 // indirect + golang.org/x/text v0.38.0 // indirect + golang.org/x/tools v0.46.0 // indirect google.golang.org/api v0.275.0 // indirect google.golang.org/genproto v0.0.0-20260406210006-6f92a3bedf2d // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect @@ -268,3 +287,5 @@ require ( // TEMP (local dev): use local protocol with the WorkerInfo dev message. // Drop once github.com/livekit/protocol publishes it. // replace github.com/livekit/protocol => ../protocol + +tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen diff --git a/go.sum b/go.sum index 61ab2ecdd..2d2426a52 100644 --- a/go.sum +++ b/go.sum @@ -60,6 +60,7 @@ github.com/Microsoft/hcsshim v0.14.1 h1:CMuB3fqQVfPdhyXhUqYdUmPUIOhJkmghCx3dJet8 github.com/Microsoft/hcsshim v0.14.1/go.mod h1:VnzvPLyWUhxiPVsJ31P6XadxCcTogTguBFDy/1GR/OM= github.com/ProtonMail/go-crypto v1.3.0 h1:ILq8+Sf5If5DCpHQp4PbZdS1J7HDFRXz/+xKBiRGFrw= github.com/ProtonMail/go-crypto v1.3.0/go.mod h1:9whxjD8Rbs29b4XWbB8irEcE8KHMqaR2e7GWU1R+/PE= +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/chroma/v2 v2.23.1 h1:nv2AVZdTyClGbVQkIzlDm/rnhk1E9bU9nXwmZ/Vk/iY= @@ -70,6 +71,8 @@ github.com/anchore/go-struct-converter v0.1.0 h1:2rDRssAl6mgKBSLNiVCMADgZRhoqtw9 github.com/anchore/go-struct-converter v0.1.0/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go-v2 v1.41.7 h1:DWpAJt66FmnnaRIOT/8ASTucrvuDPZASqhhLey6tLY8= @@ -120,6 +123,7 @@ github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY= github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= @@ -168,6 +172,9 @@ github.com/charmbracelet/x/windows v0.2.2 h1:IofanmuvaxnKHuV04sC0eBy/smG6kIKrWG2 github.com/charmbracelet/x/windows v0.2.2/go.mod h1:/8XtdKZzedat74NQFn0NGlGL4soHB0YQZrETF96h75k= github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGlqCbtI= github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8= github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= @@ -220,8 +227,8 @@ github.com/dennwc/iters v1.2.2 h1:XH2/Etihiy9ZvPOVCR+icQXeYlhbvS7k0qro4x/2qQo= github.com/dennwc/iters v1.2.2/go.mod h1:M9KuuMBeyEXYTmB7EnI9SCyALFCmPWOIxn5W1L0CjGg= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= -github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8= +github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/cli v29.4.3+incompatible h1:u+UliYm2J/rYrIh2FqHQg32neRG8GjbvNuwQRTzGspU= github.com/docker/cli v29.4.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= @@ -236,6 +243,9 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= +github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960/go.mod h1:9HQzr9D/0PGwMEbC3d5AB7oi67+h4TsQqItC1GVYG58= +github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aTknUK9w6DHLDox2r2M3DI4i2pnd3w= +github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936/go.mod h1:ttYvX5qlB+mlV1okblJqcSMtR4c52UKxDiX9GRBS8+Q= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/elliotchance/orderedmap/v3 v3.1.0 h1:j4DJ5ObEmMBt/lcwIecKcoRxIQUEnw0L804lXYDt/pg= @@ -256,12 +266,16 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frostbyte73/core v0.1.1 h1:ChhJOR7bAKOCPbA+lqDLE2cGKlCG5JXsDvvQr4YaJIA= github.com/frostbyte73/core v0.1.1/go.mod h1:mhfOtR+xWAvwXiwor7jnqPMnu4fxbv1F2MwZ0BEpzZo= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho= github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo= github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/gammazero/deque v1.2.1 h1:9fnQVFCCZ9/NOc7ccTNqzoKd1tCWOqeI05/lPqFPMGQ= github.com/gammazero/deque v1.2.1/go.mod h1:5nSFkzVm+afG9+gy0VIowlqVAW4N8zNcMne+CMQVD2g= +github.com/getkin/kin-openapi v0.135.0 h1:751SjYfbiwqukYuVjwYEIKNfrSwS5YpA7DZnKSwQgtg= +github.com/getkin/kin-openapi v0.135.0/go.mod h1:6dd5FJl6RdX4usBtFBaQhk9q62Yb2J0Mk5IhUO/QqFI= github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -269,14 +283,23 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= +github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= +github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= +github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= +github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= +github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-task/task/v3 v3.51.1 h1:vu73GWym90MT9tDdUZthkEF5XHQKOfvrxTT5uH1E2t8= github.com/go-task/task/v3 v3.51.1/go.mod h1:qiC1MCFPfGkRunIKqFbl6ybbns1OR34EkJ3Mb6+Jm7U= github.com/go-task/template v0.2.0 h1:xW7ek0o65FUSTbKcSNeg2Vyf/I7wYXFgLUznptvviBE= github.com/go-task/template v0.2.0/go.mod h1:dbdoUb6qKnHQi1y6o+IdIrs0J4o/SEhSTA6bbzZmdtc= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -285,10 +308,23 @@ github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63Y github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/cel-go v0.28.1 h1:YWIwi77J4xIsYUwAF/iIuS6haffzIHS8yWI8glSbLWM= github.com/google/cel-go v0.28.1/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= @@ -300,6 +336,7 @@ github.com/google/jsonschema-go v0.4.3 h1:/DBOLZTfDow7pe2GmaJNhltueGTtDKICi8V8p+ github.com/google/jsonschema-go v0.4.3/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= @@ -328,12 +365,17 @@ github.com/hashicorp/go-version v1.9.0 h1:CeOIz6k+LoN3qX9Z0tyQrPtiB1DFYRPfCIBtaX github.com/hashicorp/go-version v1.9.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/in-toto/attestation v1.1.2 h1:MBFn6lsMq6dptQZJBhalXTcWMb/aJy3V+GX3VYj/V1E= github.com/in-toto/attestation v1.1.2/go.mod h1:gYFddHMZj3DiQ0b62ltNi1Vj5rC879bTmBbrv9CRHpM= github.com/in-toto/in-toto-golang v0.11.0 h1:nfidMYBFx+E0lnmX5KUnN2Pdm8zdNKal1ayjJuzzRoA= github.com/in-toto/in-toto-golang v0.11.0/go.mod h1:u3PjTnwFKjp5a1YCcw8SJg0G+tMeKfVoWsWeFMDCMtw= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/jxskiss/base62 v1.1.0 h1:A5zbF8v8WXx2xixnAKD2w+abC+sIzYJX+nxmhA6HWFw= github.com/jxskiss/base62 v1.1.0/go.mod h1:HhWAlUXvxKThfOlZbcuFzsqwtF5TcqS9ru3y5GfjWAc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -367,6 +409,8 @@ github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/magefile/mage v1.17.2 h1:fyXVu1eadI8Ap1HCCNgEhJ5McIWiYhLR8uol64ZZc40= github.com/magefile/mage v1.17.2/go.mod h1:Yj51kqllmsgFpvvSzgrZPK9WtluG3kUhFaBUVLo4feA= +github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= +github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= @@ -409,6 +453,8 @@ github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modelcontextprotocol/go-sdk v1.6.1 h1:0zOSupjKUxPKSocPT1Wtago+mUHU2/uZ4xSOY0FGReU= github.com/modelcontextprotocol/go-sdk v1.6.1/go.mod h1:kzm3kzFL1/+AziGOE0nUs3gvPoNxMCvkxokMkuFapXQ= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/morikuni/aec v1.1.0 h1:vBBl0pUnvi/Je71dsRrhMBtreIqNMYErSAbEeb8jrXQ= github.com/morikuni/aec v1.1.0/go.mod h1:xDRgiq/iw5l+zkao76YTKzKttOp2cwPEne25HDkJnBw= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= @@ -425,6 +471,32 @@ github.com/nats-io/nkeys v0.4.16 h1:rd5oAuLOb8mnAycB0xleuEBNS1pVVnN0fv/FF34Eypg= github.com/nats-io/nkeys v0.4.16/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs= +github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY= +github.com/oapi-codegen/oapi-codegen/v2 v2.7.1 h1:a7Ab7YlpqkVG5HKrTaeFstm32Z5QOnyjnbsCO0jiMYM= +github.com/oapi-codegen/oapi-codegen/v2 v2.7.1/go.mod h1:qzFy6iuobJw/hD1aRILee4G87/ShmhR0xYCwcUtZMCw= +github.com/oapi-codegen/runtime v1.4.2 h1:GMxFVYLzoYLua+/KvzgSphkyK1lLTReQI9Vf4hvATKE= +github.com/oapi-codegen/runtime v1.4.2/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU= +github.com/oasdiff/yaml v0.0.9 h1:zQOvd2UKoozsSsAknnWoDJlSK4lC0mpmjfDsfqNwX48= +github.com/oasdiff/yaml v0.0.9/go.mod h1:8lvhgJG4xiKPj3HN5lDow4jZHPlx1i7dIwzkdAo6oAM= +github.com/oasdiff/yaml3 v0.0.9 h1:rWPrKccrdUm8J0F3sGuU+fuh9+1K/RdJlWF7O/9yw2g= +github.com/oasdiff/yaml3 v0.0.9/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= @@ -441,6 +513,8 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pierrec/lz4/v4 v4.1.26 h1:GrpZw1gZttORinvzBdXPUXATeqlJjqUG/D87TKMnhjY= github.com/pierrec/lz4/v4 v4.1.26/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4= github.com/pion/datachannel v1.6.0 h1:XecBlj+cvsxhAMZWFfFcPyUaDZtd7IJvrXqlXD/53i0= @@ -510,10 +584,11 @@ github.com/sebdah/goldie/v2 v2.8.0 h1:dZb9wR8q5++oplmEiJT+U/5KyotVD+HNGCAc5gNr8r github.com/sebdah/goldie/v2 v2.8.0/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI= github.com/secure-systems-lab/go-securesystemslib v0.10.0 h1:l+H5ErcW0PAehBNrBxoGv1jjNpGYdZ9RcheFkB2WI14= github.com/secure-systems-lab/go-securesystemslib v0.10.0/go.mod h1:MRKONWmRoFzPNQ9USRF9i1mc7MvAVvF1LlW8X5VWDvk= -github.com/segmentio/asm v1.1.3 h1:WM03sfUOENvvKexOLp+pCqgb/WDjsi7EK8gIsICtzhc= -github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg= +github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0= +github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0= github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI= @@ -528,15 +603,21 @@ github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/spdx/tools-golang v0.5.7 h1:+sWcKGnhwp3vLdMqPcLdA6QK679vd86cK9hQWH3AwCg= github.com/spdx/tools-golang v0.5.7/go.mod h1:jg7w0LOpoNAw6OxKEzCoqPC2GCTj45LyTlVmXubDsYw= +github.com/speakeasy-api/jsonpath v0.6.3 h1:c+QPwzAOdrWvzycuc9HFsIZcxKIaWcNpC+xhOW9rJxU= +github.com/speakeasy-api/jsonpath v0.6.3/go.mod h1:2cXloNuQ+RSXi5HTRaeBh7JEmjRXTiaKpFTdZiL7URI= +github.com/speakeasy-api/openapi v1.19.2 h1:md90tE71/M8jS3cuRlsuWP5Aed4xoG5PSRvXeZgCv/M= +github.com/speakeasy-api/openapi v1.19.2/go.mod h1:UfKa7FqE4jgexJZuj51MmdHAFGmDv0Zaw3+yOd81YKU= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tonistiigi/fsutil v0.0.0-20251211185533-a2aa163d723f h1:Z4NEQ86qFl1mHuCu9gwcE+EYCwDKfXAYXZbdIXyxmEA= @@ -553,14 +634,20 @@ github.com/u-root/u-root v0.16.0 h1:wY40O83MBVks97+Is0WlFlOPSwKQMIrWP9R1IsrExg8= github.com/u-root/u-root v0.16.0/go.mod h1:yL/XdSSW27PdGLgUh4MNRBy54mKM+TBLzpwiB4nwj90= github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 h1:pyC9PaHYZFgEKFdlp3G8RaCKgVpHZnecvArXvPXcFkM= github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701/go.mod h1:P3a5rG4X7tI17Nn3aOIAYr5HbIMukwXG0urG0WuL8OA= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli/v3 v3.9.0 h1:AV9lIiPv3ukYnxunaCUsHnEozptYmDN2F0+yWqLMn/c= github.com/urfave/cli/v3 v3.9.0/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= github.com/vbatts/tar-split v0.12.2 h1:w/Y6tjxpeiFMR47yzZPlPj/FcPLpXbTUi/9H7d3CPa4= github.com/vbatts/tar-split v0.12.2/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA= +github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk= +github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ= github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU= github.com/wlynxg/anet v0.0.5/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= +github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQsBgUlc= +github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= @@ -622,48 +709,69 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= -golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= +golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= +golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= golang.org/x/exp v0.0.0-20260603202125-055de637280b h1:v1uXiEBHo8QA0LiGCo7UgHMzHT4Kdfpl2zmtH5vaP1Q= golang.org/x/exp v0.0.0-20260603202125-055de637280b/go.mod h1:d2fgXJLVs4dYDHUk5lwMIfzRzSrWCfGZb0ZqeLa/Vcw= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4= -golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ= +golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= +golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= +golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8= -golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0= +golang.org/x/tools v0.46.0 h1:7jTurBkPZu4moS/Uy4OQT1M+QBlsj3wejyZwsT8Z7rk= +golang.org/x/tools v0.46.0/go.mod h1:FrD85F8l+NWL+9XWBSyVSHO6Ne4jutsfIFba7AWQ5Ys= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -680,16 +788,33 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.81.1 h1:VnnIIZ88UzOOKLukQi+ImGz8O1Wdp8nAGGnvOfEIWQQ= google.golang.org/grpc v1.81.1/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191026110619-0b21df46bc1d/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= diff --git a/pkg/config/config.go b/pkg/config/config.go index eebe19d77..2182e3b73 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -1,4 +1,4 @@ -// Copyright 2022-2024 LiveKit, Inc. +// Copyright 2022-2026 LiveKit, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import ( "os" "path" "strings" + "time" "github.com/livekit/livekit-cli/v2/pkg/util" "gopkg.in/yaml.v3" @@ -27,7 +28,9 @@ import ( type CLIConfig struct { DefaultProject string `yaml:"default_project"` + DefaultUser string `yaml:"default_user"` Projects []ProjectConfig `yaml:"projects"` + Users []UserConfig `yaml:"users"` DeviceName string `yaml:"device_name"` Theme string `yaml:"theme"` // absent from YAML @@ -42,6 +45,83 @@ type ProjectConfig struct { APISecret string `yaml:"api_secret"` } +type UserConfig struct { + Id string `yaml:"id"` + Name string `yaml:"name"` + Email string `yaml:"email"` + SessionToken string `yaml:"session_token"` + SessionExpiry int64 `yaml:"session_expiry"` + // Projects caches the projects this user can access, as last fetched from + // the Public API (listProjects). Caching lets project resolution avoid a + // network round-trip on every command; ProjectsFetchedAt records the Unix + // time it was populated so callers can refresh a stale cache. + Projects []UserProjectConfig `yaml:"projects,omitempty"` + ProjectsFetchedAt int64 `yaml:"projects_fetched_at,omitempty"` +} + +// UserProjectConfig is a project accessible under user-based auth. Unlike +// ProjectConfig it carries no API key/secret: requests are authorized with the +// user's session token and scoped to a project by id. +type UserProjectConfig struct { + ProjectId string `yaml:"project_id"` + Name string `yaml:"name,omitempty"` + Subdomain string `yaml:"subdomain,omitempty"` + URL string `yaml:"url,omitempty"` +} + +// SessionValid reports whether the user has a session token that has not +// expired. A zero SessionExpiry means "no known expiry" and is treated as +// valid, so a manually-injected token without an expiry remains usable. +func (u *UserConfig) SessionValid() bool { + if u == nil || u.SessionToken == "" { + return false + } + return u.SessionExpiry == 0 || time.Now().Unix() < u.SessionExpiry +} + +// GetUser returns the configured user matching idOrEmail (by id, or +// case-insensitively by email), or nil if none is configured. The returned +// pointer aliases the slice element, so mutations persist through a subsequent +// PersistIfNeeded on the same CLIConfig. +func (c *CLIConfig) GetUser(idOrEmail string) *UserConfig { + for i := range c.Users { + u := &c.Users[i] + if u.Id == idOrEmail || (u.Email != "" && strings.EqualFold(u.Email, idOrEmail)) { + return u + } + } + return nil +} + +// LoadDefaultUser returns the configured default user. It mirrors +// LoadDefaultProject and is used by user-based (experimental) auth. +func LoadDefaultUser() (*UserConfig, error) { + conf, err := LoadOrCreate() + if err != nil { + return nil, err + } + if conf.DefaultUser == "" { + return nil, errors.New("no default user set. Run `lk cloud auth` to sign in") + } + if u := conf.GetUser(conf.DefaultUser); u != nil { + return u, nil + } + return nil, fmt.Errorf("default user %q not found in config", conf.DefaultUser) +} + +// SetUserProjects replaces the cached project list for the user identified by +// idOrEmail and persists the config. fetchedAt is the Unix time the list was +// retrieved. +func (c *CLIConfig) SetUserProjects(idOrEmail string, projects []UserProjectConfig, fetchedAt int64) error { + u := c.GetUser(idOrEmail) + if u == nil { + return fmt.Errorf("user %q not found in config", idOrEmail) + } + u.Projects = projects + u.ProjectsFetchedAt = fetchedAt + return c.PersistIfNeeded() +} + func LoadDefaultProject() (*ProjectConfig, error) { conf, err := LoadOrCreate() if err != nil { diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go new file mode 100644 index 000000000..45e4ef4c4 --- /dev/null +++ b/pkg/config/config_test.go @@ -0,0 +1,63 @@ +// Copyright 2026 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package config + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func TestUserConfigSessionValid(t *testing.T) { + now := time.Now().Unix() + tests := []struct { + name string + user *UserConfig + want bool + }{ + {"nil user", nil, false}, + {"no token", &UserConfig{SessionToken: ""}, false}, + {"token, no expiry", &UserConfig{SessionToken: "t"}, true}, + {"token, future expiry", &UserConfig{SessionToken: "t", SessionExpiry: now + 3600}, true}, + {"token, past expiry", &UserConfig{SessionToken: "t", SessionExpiry: now - 3600}, false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, tt.user.SessionValid()) + }) + } +} + +func TestCLIConfigGetUser(t *testing.T) { + c := &CLIConfig{ + Users: []UserConfig{ + {Id: "usr_1", Email: "Alice@LiveKit.io"}, + {Id: "usr_2", Email: "bob@livekit.io"}, + }, + } + + assert.Equal(t, "usr_1", c.GetUser("usr_1").Id) + // email match is case-insensitive + assert.Equal(t, "usr_1", c.GetUser("alice@livekit.io").Id) + assert.Equal(t, "usr_2", c.GetUser("bob@livekit.io").Id) + assert.Nil(t, c.GetUser("nobody@livekit.io")) + assert.Nil(t, c.GetUser("")) + + // GetUser returns an aliasing pointer: mutations are visible on the config. + c.GetUser("usr_1").Projects = []UserProjectConfig{{ProjectId: "p_abc"}} + assert.Len(t, c.Users[0].Projects, 1) + assert.Equal(t, "p_abc", c.Users[0].Projects[0].ProjectId) +} diff --git a/pkg/public/client.go b/pkg/public/client.go new file mode 100644 index 000000000..47bd2c5db --- /dev/null +++ b/pkg/public/client.go @@ -0,0 +1,154 @@ +// Copyright 2026 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package public + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + + "github.com/livekit/livekit-cli/v2/pkg/public/oapi" +) + +// DefaultBaseURL is the production base URL of the LiveKit Public API. Override +// it (e.g. to http://localhost:8000/v1) for local development. +const DefaultBaseURL = "https://api.livekit.cloud/v1" + +// Client is the CLI's client for the user-authenticated LiveKit Public API. It +// wraps the oapi-codegen-generated client (package oapi) and exposes the small +// set of domain types and operations the CLI needs, insulating callers from the +// generated surface (which is regenerated from the OpenAPI spec). +type Client struct { + gen *oapi.ClientWithResponses +} + +// Project is a project the authenticated user can access. +// +// NOTE: the published spec does not yet describe the project endpoints (they +// are 501-only, with no success schema), so ListProjects/GetProject decode +// their responses by hand below rather than through generated types. This +// mirror carries only the id the server currently returns; extend it (and the +// decoding) as the endpoints — ideally the spec itself — grow. +type Project struct { + ID string +} + +// New builds a Client for the Public API at baseURL, authenticating every +// request with the given user session token. If baseURL is empty, DefaultBaseURL +// is used. +func New(baseURL, token string, opts ...oapi.ClientOption) (*Client, error) { + if baseURL == "" { + baseURL = DefaultBaseURL + } + // Prepend the bearer-auth editor so callers' opts can still override it. + opts = append([]oapi.ClientOption{oapi.WithRequestEditorFn(bearerAuth(token))}, opts...) + gen, err := oapi.NewClientWithResponses(baseURL, opts...) + if err != nil { + return nil, err + } + return &Client{gen: gen}, nil +} + +// bearerAuth returns a request editor that authorizes each request with the +// user session token. +func bearerAuth(token string) oapi.RequestEditorFn { + return func(_ context.Context, req *http.Request) error { + req.Header.Set("Authorization", "Bearer "+token) + return nil + } +} + +// ListProjects returns the projects the authenticated user can access. +func (c *Client) ListProjects(ctx context.Context) ([]Project, error) { + resp, err := c.gen.ListProjectsWithResponse(ctx) + if err != nil { + return nil, err + } + if resp.StatusCode() != http.StatusOK { + return nil, responseError(resp.StatusCode(), resp.Body) + } + // The spec has no schema for this endpoint yet, so decode the body directly. + var body []struct { + ID string `json:"id"` + } + if err := json.Unmarshal(resp.Body, &body); err != nil { + return nil, fmt.Errorf("decode projects: %w", err) + } + projects := make([]Project, len(body)) + for i, p := range body { + projects[i] = Project{ID: p.ID} + } + return projects, nil +} + +// GetProject returns a single project by id. +func (c *Client) GetProject(ctx context.Context, projectID string) (*Project, error) { + resp, err := c.gen.GetProjectWithResponse(ctx, projectID) + if err != nil { + return nil, err + } + if resp.StatusCode() != http.StatusOK { + return nil, responseError(resp.StatusCode(), resp.Body) + } + var body struct { + ID string `json:"id"` + } + if err := json.Unmarshal(resp.Body, &body); err != nil { + return nil, fmt.Errorf("decode project: %w", err) + } + return &Project{ID: body.ID}, nil +} + +// APIError is a structured error from the Public API. It carries the HTTP status +// and, when the body decoded as the spec's Error schema, its code and message. +// Callers can errors.As for it — notably via IsUnauthenticated. +type APIError struct { + Status int + Code string + Message string +} + +func (e *APIError) Error() string { + if e.Code == "" { + return e.Message + } + return fmt.Sprintf("%s: %s", e.Code, e.Message) +} + +// IsUnauthenticated reports whether err is an APIError signalling a missing or +// invalid session (HTTP 401), which the CLI surfaces as a prompt to re-run +// `lk cloud auth`. +func IsUnauthenticated(err error) bool { + var apiErr *APIError + return errors.As(err, &apiErr) && (apiErr.Status == http.StatusUnauthorized || apiErr.Code == "unauthenticated") +} + +// responseError builds an APIError from a non-2xx response. It prefers the +// spec's structured Error body ({error:{code,message}}) and falls back to the +// raw body when the server returned an unexpected shape or content type. +func responseError(status int, body []byte) error { + var e oapi.Error + if err := json.Unmarshal(body, &e); err == nil && e.Error.Code != "" { + return &APIError{Status: status, Code: e.Error.Code, Message: e.Error.Message} + } + msg := strings.TrimSpace(string(body)) + if msg == "" { + msg = http.StatusText(status) + } + return &APIError{Status: status, Message: fmt.Sprintf("unexpected response (HTTP %d): %s", status, msg)} +} diff --git a/pkg/public/gen.go b/pkg/public/gen.go new file mode 100644 index 000000000..b8bc096c8 --- /dev/null +++ b/pkg/public/gen.go @@ -0,0 +1,45 @@ +// Copyright 2026 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package public is the CLI's client for the LiveKit Public API (the +// user-authenticated OpenAPI REST service), named to match public-api-server. +// The typed client under ./oapi is generated by oapi-codegen from an OpenAPI +// 3.1 spec — the same generator public-api-server uses for its server bindings +// (see ./oapi/generate.go and ./oapi/cfg.yaml). +// +// # Source of truth +// +// The authoritative spec is the published document served by the API itself, +// and no copy is kept in this repo. Regeneration fetches it directly (oapi-codegen +// loads http(s) URLs), defaulting to production; override for a local/staging +// server with LK_OPENAPI_SPEC_URL. +// +// The generate directive is gated behind the `oapigen` build tag so a plain +// `go generate ./...` never reaches the network — regenerate deliberately: +// +// go generate -tags oapigen ./pkg/public/... # prod +// LK_OPENAPI_SPEC_URL=http://localhost:8080/openapi.yaml go generate -tags oapigen ./pkg/public/... +// +// The committed artifact is the generated ./oapi/oapi.gen.go, which is what +// keeps ordinary `go build`/`go test` reproducible and offline — only +// regeneration needs the network. The gated directive and the fetch live in +// ./oapi (generate.go, generate.sh, cfg.yaml). +// +// NOTE (temporary): the published spec does not yet describe the project +// endpoints (listProjects/getProject are 501-only, no success schema), so no +// Project type is generated. The client wraps those two endpoints by hand +// (see Client.ListProjects / GetProject in client.go) until the spec declares +// their schemas, at which point the hand-decoding can be replaced with the +// generated types. +package public diff --git a/pkg/public/oapi/cfg.yaml b/pkg/public/oapi/cfg.yaml new file mode 100644 index 000000000..afbe549f7 --- /dev/null +++ b/pkg/public/oapi/cfg.yaml @@ -0,0 +1,15 @@ +# oapi-codegen configuration for the CLI's LiveKit Public API client. +# +# Generates Go models and a net/http client. The spec is fetched from its +# published URL at generate time (see generate.sh); no spec copy is kept in the +# repo. This mirrors public-api-server's oapi-codegen setup (pkg/api/v1/oapi) so +# the two sides share a generator and conventions — the CLI generates a `client` +# where the server generates a `std-http-server`. See ../gen.go. +package: oapi +output: oapi.gen.go +generate: + models: true + client: true +output-options: + # Keep the generated file readable and stable. + skip-prune: false diff --git a/pkg/public/oapi/generate.go b/pkg/public/oapi/generate.go new file mode 100644 index 000000000..d73f97df2 --- /dev/null +++ b/pkg/public/oapi/generate.go @@ -0,0 +1,26 @@ +// Copyright 2026 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build oapigen + +package oapi + +// This file carries only the code-generation directive for package oapi. It is +// gated behind the `oapigen` build tag so a plain `go generate ./...` never +// reaches out to fetch the spec; regenerate deliberately with: +// +// go generate -tags oapigen ./pkg/public/... +// +// See ../gen.go for the source of truth and generate.sh for the fetch itself. +//go:generate sh generate.sh diff --git a/pkg/public/oapi/generate.sh b/pkg/public/oapi/generate.sh new file mode 100644 index 000000000..a639288e5 --- /dev/null +++ b/pkg/public/oapi/generate.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Regenerates oapi.gen.go from the LiveKit Public API OpenAPI spec. +# +# The spec is fetched directly from its published URL by oapi-codegen (which +# loads http(s) URLs natively) — no local copy of the spec is kept in the repo. +# Defaults to production; override for a local/staging server. The directive is +# gated behind the `oapigen` build tag, so regenerate deliberately with: +# +# go generate -tags oapigen ./pkg/public/... +# LK_OPENAPI_SPEC_URL=http://localhost:8080/openapi.yaml go generate -tags oapigen ./pkg/public/... +# +# Invoked by the //go:generate directive in generate.go (runs in this directory, +# alongside cfg.yaml). +set -eu + +SPEC_URL="${LK_OPENAPI_SPEC_URL:-https://api.livekit.io/openapi.yaml}" +echo "oapi-codegen: generating client from ${SPEC_URL}" +exec go tool oapi-codegen -config cfg.yaml "${SPEC_URL}" diff --git a/pkg/public/oapi/oapi.gen.go b/pkg/public/oapi/oapi.gen.go new file mode 100644 index 000000000..23191a301 --- /dev/null +++ b/pkg/public/oapi/oapi.gen.go @@ -0,0 +1,5639 @@ +// Package oapi provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT. +package oapi + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + "time" + + "github.com/oapi-codegen/runtime" + openapi_types "github.com/oapi-codegen/runtime/types" +) + +const ( + BearerAuthScopes bearerAuthContextKey = "bearerAuth.Scopes" +) + +// Defines values for EgressState. +const ( + EgressStateActive EgressState = "active" + EgressStateEnded EgressState = "ended" + EgressStateNever EgressState = "never" +) + +// Valid indicates whether the value is a known member of the EgressState enum. +func (e EgressState) Valid() bool { + switch e { + case EgressStateActive: + return true + case EgressStateEnded: + return true + case EgressStateNever: + return true + default: + return false + } +} + +// Defines values for EgressStatus. +const ( + EGRESSABORTED EgressStatus = "EGRESS_ABORTED" + EGRESSACTIVE EgressStatus = "EGRESS_ACTIVE" + EGRESSCOMPLETE EgressStatus = "EGRESS_COMPLETE" + EGRESSENDING EgressStatus = "EGRESS_ENDING" + EGRESSFAILED EgressStatus = "EGRESS_FAILED" + EGRESSLIMITREACHED EgressStatus = "EGRESS_LIMIT_REACHED" + EGRESSSTARTING EgressStatus = "EGRESS_STARTING" +) + +// Valid indicates whether the value is a known member of the EgressStatus enum. +func (e EgressStatus) Valid() bool { + switch e { + case EGRESSABORTED: + return true + case EGRESSACTIVE: + return true + case EGRESSCOMPLETE: + return true + case EGRESSENDING: + return true + case EGRESSFAILED: + return true + case EGRESSLIMITREACHED: + return true + case EGRESSSTARTING: + return true + default: + return false + } +} + +// Defines values for ExportDataset. +const ( + Egresses ExportDataset = "egresses" + Ingresses ExportDataset = "ingresses" + Sessions ExportDataset = "sessions" + SipCalls ExportDataset = "sip-calls" + Usage ExportDataset = "usage" +) + +// Valid indicates whether the value is a known member of the ExportDataset enum. +func (e ExportDataset) Valid() bool { + switch e { + case Egresses: + return true + case Ingresses: + return true + case Sessions: + return true + case SipCalls: + return true + case Usage: + return true + default: + return false + } +} + +// Defines values for ExportFormat. +const ( + Csv ExportFormat = "csv" + Jsonl ExportFormat = "jsonl" +) + +// Valid indicates whether the value is a known member of the ExportFormat enum. +func (e ExportFormat) Valid() bool { + switch e { + case Csv: + return true + case Jsonl: + return true + default: + return false + } +} + +// Defines values for ExportStatus. +const ( + Canceled ExportStatus = "canceled" + Completed ExportStatus = "completed" + Expired ExportStatus = "expired" + Failed ExportStatus = "failed" + Pending ExportStatus = "pending" + Running ExportStatus = "running" +) + +// Valid indicates whether the value is a known member of the ExportStatus enum. +func (e ExportStatus) Valid() bool { + switch e { + case Canceled: + return true + case Completed: + return true + case Expired: + return true + case Failed: + return true + case Pending: + return true + case Running: + return true + default: + return false + } +} + +// Defines values for Feature. +const ( + FeatureAgent Feature = "agent" + FeatureEgress Feature = "egress" + FeatureIngress Feature = "ingress" + FeatureSip Feature = "sip" + FeatureTranscription Feature = "transcription" +) + +// Valid indicates whether the value is a known member of the Feature enum. +func (e Feature) Valid() bool { + switch e { + case FeatureAgent: + return true + case FeatureEgress: + return true + case FeatureIngress: + return true + case FeatureSip: + return true + case FeatureTranscription: + return true + default: + return false + } +} + +// Defines values for IngressStatus. +const ( + ENDPOINTBUFFERING IngressStatus = "ENDPOINT_BUFFERING" + ENDPOINTCOMPLETE IngressStatus = "ENDPOINT_COMPLETE" + ENDPOINTERROR IngressStatus = "ENDPOINT_ERROR" + ENDPOINTINACTIVE IngressStatus = "ENDPOINT_INACTIVE" + ENDPOINTPUBLISHING IngressStatus = "ENDPOINT_PUBLISHING" +) + +// Valid indicates whether the value is a known member of the IngressStatus enum. +func (e IngressStatus) Valid() bool { + switch e { + case ENDPOINTBUFFERING: + return true + case ENDPOINTCOMPLETE: + return true + case ENDPOINTERROR: + return true + case ENDPOINTINACTIVE: + return true + case ENDPOINTPUBLISHING: + return true + default: + return false + } +} + +// Defines values for SessionStatus. +const ( + SessionStatusActive SessionStatus = "active" + SessionStatusClosed SessionStatus = "closed" +) + +// Valid indicates whether the value is a known member of the SessionStatus enum. +func (e SessionStatus) Valid() bool { + switch e { + case SessionStatusActive: + return true + case SessionStatusClosed: + return true + default: + return false + } +} + +// Defines values for SipCallStatus. +const ( + SCSACTIVE SipCallStatus = "SCS_ACTIVE" + SCSCALLINCOMING SipCallStatus = "SCS_CALL_INCOMING" + SCSDISCONNECTED SipCallStatus = "SCS_DISCONNECTED" + SCSERROR SipCallStatus = "SCS_ERROR" + SCSPARTICIPANTJOINED SipCallStatus = "SCS_PARTICIPANT_JOINED" +) + +// Valid indicates whether the value is a known member of the SipCallStatus enum. +func (e SipCallStatus) Valid() bool { + switch e { + case SCSACTIVE: + return true + case SCSCALLINCOMING: + return true + case SCSDISCONNECTED: + return true + case SCSERROR: + return true + case SCSPARTICIPANTJOINED: + return true + default: + return false + } +} + +// Defines values for SipDirection. +const ( + SipDirectionInbound SipDirection = "inbound" + SipDirectionOutbound SipDirection = "outbound" +) + +// Valid indicates whether the value is a known member of the SipDirection enum. +func (e SipDirection) Valid() bool { + switch e { + case SipDirectionInbound: + return true + case SipDirectionOutbound: + return true + default: + return false + } +} + +// Defines values for SipEventEventType. +const ( + SipEventEventTypeSIPCALLENDED SipEventEventType = "SIP_CALL_ENDED" + SipEventEventTypeSIPCALLINCOMING SipEventEventType = "SIP_CALL_INCOMING" + SipEventEventTypeSIPCALLSTARTED SipEventEventType = "SIP_CALL_STARTED" + SipEventEventTypeSIPPARTICIPANTCREATED SipEventEventType = "SIP_PARTICIPANT_CREATED" + SipEventEventTypeSIPTRANSFERCOMPLETE SipEventEventType = "SIP_TRANSFER_COMPLETE" + SipEventEventTypeSIPTRANSFERREQUESTED SipEventEventType = "SIP_TRANSFER_REQUESTED" +) + +// Valid indicates whether the value is a known member of the SipEventEventType enum. +func (e SipEventEventType) Valid() bool { + switch e { + case SipEventEventTypeSIPCALLENDED: + return true + case SipEventEventTypeSIPCALLINCOMING: + return true + case SipEventEventTypeSIPCALLSTARTED: + return true + case SipEventEventTypeSIPPARTICIPANTCREATED: + return true + case SipEventEventTypeSIPTRANSFERCOMPLETE: + return true + case SipEventEventTypeSIPTRANSFERREQUESTED: + return true + default: + return false + } +} + +// Defines values for TimeseriesResponseInterval. +const ( + TimeseriesResponseIntervalDay TimeseriesResponseInterval = "day" + TimeseriesResponseIntervalHour TimeseriesResponseInterval = "hour" + TimeseriesResponseIntervalMinute TimeseriesResponseInterval = "minute" +) + +// Valid indicates whether the value is a known member of the TimeseriesResponseInterval enum. +func (e TimeseriesResponseInterval) Valid() bool { + switch e { + case TimeseriesResponseIntervalDay: + return true + case TimeseriesResponseIntervalHour: + return true + case TimeseriesResponseIntervalMinute: + return true + default: + return false + } +} + +// Defines values for Interval. +const ( + IntervalDay Interval = "day" + IntervalHour Interval = "hour" + IntervalMinute Interval = "minute" +) + +// Valid indicates whether the value is a known member of the Interval enum. +func (e Interval) Valid() bool { + switch e { + case IntervalDay: + return true + case IntervalHour: + return true + case IntervalMinute: + return true + default: + return false + } +} + +// Defines values for Order. +const ( + OrderAsc Order = "asc" + OrderDesc Order = "desc" +) + +// Valid indicates whether the value is a known member of the Order enum. +func (e Order) Valid() bool { + switch e { + case OrderAsc: + return true + case OrderDesc: + return true + default: + return false + } +} + +// Defines values for ListProjectEgressesParamsOrder. +const ( + ListProjectEgressesParamsOrderAsc ListProjectEgressesParamsOrder = "asc" + ListProjectEgressesParamsOrderDesc ListProjectEgressesParamsOrder = "desc" +) + +// Valid indicates whether the value is a known member of the ListProjectEgressesParamsOrder enum. +func (e ListProjectEgressesParamsOrder) Valid() bool { + switch e { + case ListProjectEgressesParamsOrderAsc: + return true + case ListProjectEgressesParamsOrderDesc: + return true + default: + return false + } +} + +// Defines values for ListProjectIngressesParamsOrder. +const ( + ListProjectIngressesParamsOrderAsc ListProjectIngressesParamsOrder = "asc" + ListProjectIngressesParamsOrderDesc ListProjectIngressesParamsOrder = "desc" +) + +// Valid indicates whether the value is a known member of the ListProjectIngressesParamsOrder enum. +func (e ListProjectIngressesParamsOrder) Valid() bool { + switch e { + case ListProjectIngressesParamsOrderAsc: + return true + case ListProjectIngressesParamsOrderDesc: + return true + default: + return false + } +} + +// Defines values for ListProjectSessionsParamsOrder. +const ( + ListProjectSessionsParamsOrderAsc ListProjectSessionsParamsOrder = "asc" + ListProjectSessionsParamsOrderDesc ListProjectSessionsParamsOrder = "desc" +) + +// Valid indicates whether the value is a known member of the ListProjectSessionsParamsOrder enum. +func (e ListProjectSessionsParamsOrder) Valid() bool { + switch e { + case ListProjectSessionsParamsOrderAsc: + return true + case ListProjectSessionsParamsOrderDesc: + return true + default: + return false + } +} + +// Defines values for ListProjectSessionsParamsSort. +const ( + EndedAt ListProjectSessionsParamsSort = "endedAt" + StartedAt ListProjectSessionsParamsSort = "startedAt" +) + +// Valid indicates whether the value is a known member of the ListProjectSessionsParamsSort enum. +func (e ListProjectSessionsParamsSort) Valid() bool { + switch e { + case EndedAt: + return true + case StartedAt: + return true + default: + return false + } +} + +// Defines values for ListProjectSessionsParamsStatus. +const ( + Active ListProjectSessionsParamsStatus = "active" + Closed ListProjectSessionsParamsStatus = "closed" +) + +// Valid indicates whether the value is a known member of the ListProjectSessionsParamsStatus enum. +func (e ListProjectSessionsParamsStatus) Valid() bool { + switch e { + case Active: + return true + case Closed: + return true + default: + return false + } +} + +// Defines values for ListProjectSipCallsParamsOrder. +const ( + ListProjectSipCallsParamsOrderAsc ListProjectSipCallsParamsOrder = "asc" + ListProjectSipCallsParamsOrderDesc ListProjectSipCallsParamsOrder = "desc" +) + +// Valid indicates whether the value is a known member of the ListProjectSipCallsParamsOrder enum. +func (e ListProjectSipCallsParamsOrder) Valid() bool { + switch e { + case ListProjectSipCallsParamsOrderAsc: + return true + case ListProjectSipCallsParamsOrderDesc: + return true + default: + return false + } +} + +// Defines values for ListProjectSipCallsParamsDirection. +const ( + ListProjectSipCallsParamsDirectionInbound ListProjectSipCallsParamsDirection = "inbound" + ListProjectSipCallsParamsDirectionOutbound ListProjectSipCallsParamsDirection = "outbound" +) + +// Valid indicates whether the value is a known member of the ListProjectSipCallsParamsDirection enum. +func (e ListProjectSipCallsParamsDirection) Valid() bool { + switch e { + case ListProjectSipCallsParamsDirectionInbound: + return true + case ListProjectSipCallsParamsDirectionOutbound: + return true + default: + return false + } +} + +// Defines values for ListSipCallEventsParamsOrder. +const ( + ListSipCallEventsParamsOrderAsc ListSipCallEventsParamsOrder = "asc" + ListSipCallEventsParamsOrderDesc ListSipCallEventsParamsOrder = "desc" +) + +// Valid indicates whether the value is a known member of the ListSipCallEventsParamsOrder enum. +func (e ListSipCallEventsParamsOrder) Valid() bool { + switch e { + case ListSipCallEventsParamsOrderAsc: + return true + case ListSipCallEventsParamsOrderDesc: + return true + default: + return false + } +} + +// Defines values for ListSipCallEventsParamsEventType. +const ( + ListSipCallEventsParamsEventTypeSIPCALLENDED ListSipCallEventsParamsEventType = "SIP_CALL_ENDED" + ListSipCallEventsParamsEventTypeSIPCALLINCOMING ListSipCallEventsParamsEventType = "SIP_CALL_INCOMING" + ListSipCallEventsParamsEventTypeSIPCALLSTARTED ListSipCallEventsParamsEventType = "SIP_CALL_STARTED" + ListSipCallEventsParamsEventTypeSIPPARTICIPANTCREATED ListSipCallEventsParamsEventType = "SIP_PARTICIPANT_CREATED" + ListSipCallEventsParamsEventTypeSIPTRANSFERCOMPLETE ListSipCallEventsParamsEventType = "SIP_TRANSFER_COMPLETE" + ListSipCallEventsParamsEventTypeSIPTRANSFERREQUESTED ListSipCallEventsParamsEventType = "SIP_TRANSFER_REQUESTED" +) + +// Valid indicates whether the value is a known member of the ListSipCallEventsParamsEventType enum. +func (e ListSipCallEventsParamsEventType) Valid() bool { + switch e { + case ListSipCallEventsParamsEventTypeSIPCALLENDED: + return true + case ListSipCallEventsParamsEventTypeSIPCALLINCOMING: + return true + case ListSipCallEventsParamsEventTypeSIPCALLSTARTED: + return true + case ListSipCallEventsParamsEventTypeSIPPARTICIPANTCREATED: + return true + case ListSipCallEventsParamsEventTypeSIPTRANSFERCOMPLETE: + return true + case ListSipCallEventsParamsEventTypeSIPTRANSFERREQUESTED: + return true + default: + return false + } +} + +// Defines values for QueryProjectTimeseriesParamsMetric. +const ( + ActiveParticipants QueryProjectTimeseriesParamsMetric = "activeParticipants" + BandwidthIn QueryProjectTimeseriesParamsMetric = "bandwidthIn" + BandwidthOut QueryProjectTimeseriesParamsMetric = "bandwidthOut" + ConnectionQuality QueryProjectTimeseriesParamsMetric = "connectionQuality" + ConnectionSuccessRate QueryProjectTimeseriesParamsMetric = "connectionSuccessRate" + ParticipantMinutes QueryProjectTimeseriesParamsMetric = "participantMinutes" + PublishBitrate QueryProjectTimeseriesParamsMetric = "publishBitrate" + PublishFramerate QueryProjectTimeseriesParamsMetric = "publishFramerate" + SubscribeBitrate QueryProjectTimeseriesParamsMetric = "subscribeBitrate" + SubscribeFramerate QueryProjectTimeseriesParamsMetric = "subscribeFramerate" +) + +// Valid indicates whether the value is a known member of the QueryProjectTimeseriesParamsMetric enum. +func (e QueryProjectTimeseriesParamsMetric) Valid() bool { + switch e { + case ActiveParticipants: + return true + case BandwidthIn: + return true + case BandwidthOut: + return true + case ConnectionQuality: + return true + case ConnectionSuccessRate: + return true + case ParticipantMinutes: + return true + case PublishBitrate: + return true + case PublishFramerate: + return true + case SubscribeBitrate: + return true + case SubscribeFramerate: + return true + default: + return false + } +} + +// Defines values for QueryProjectTimeseriesParamsInterval. +const ( + Day QueryProjectTimeseriesParamsInterval = "day" + Hour QueryProjectTimeseriesParamsInterval = "hour" + Minute QueryProjectTimeseriesParamsInterval = "minute" +) + +// Valid indicates whether the value is a known member of the QueryProjectTimeseriesParamsInterval enum. +func (e QueryProjectTimeseriesParamsInterval) Valid() bool { + switch e { + case Day: + return true + case Hour: + return true + case Minute: + return true + default: + return false + } +} + +// Defines values for QueryProjectTimeseriesParamsGroupBy. +const ( + RoomName QueryProjectTimeseriesParamsGroupBy = "roomName" + SessionId QueryProjectTimeseriesParamsGroupBy = "sessionId" +) + +// Valid indicates whether the value is a known member of the QueryProjectTimeseriesParamsGroupBy enum. +func (e QueryProjectTimeseriesParamsGroupBy) Valid() bool { + switch e { + case RoomName: + return true + case SessionId: + return true + default: + return false + } +} + +// ConnectionCounts Per-session connection counters. +type ConnectionCounts struct { + Attempts *int64 `json:"attempts,omitempty"` + Success *int64 `json:"success,omitempty"` +} + +// DailyUsage defines model for DailyUsage. +type DailyUsage struct { + ConnectionSeconds *string `json:"connectionSeconds,omitempty"` + Date *openapi_types.Date `json:"date,omitempty"` + DownstreamBytes *string `json:"downstreamBytes,omitempty"` + EgressAudioSeconds *string `json:"egressAudioSeconds,omitempty"` + EgressVideoSeconds *string `json:"egressVideoSeconds,omitempty"` + IngressAudioSeconds *string `json:"ingressAudioSeconds,omitempty"` + IngressVideoSeconds *string `json:"ingressVideoSeconds,omitempty"` + SipSeconds *string `json:"sipSeconds,omitempty"` +} + +// Egress defines model for Egress. +type Egress struct { + // Duration Duration in seconds. + Duration *string `json:"duration,omitempty"` + EgressId *string `json:"egressId,omitempty"` + EndedAt *time.Time `json:"endedAt,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + + // Status Egress lifecycle status (mirrors `livekit.EgressStatus`). + Status *EgressStatus `json:"status,omitempty"` + Tags *[]string `json:"tags,omitempty"` + + // Type Request type (`web`, `track`, `track_composite`, `room_composite`, `participant`). + Type *string `json:"type,omitempty"` +} + +// EgressDetail Exactly one of `web`, `track`, `trackComposite`, `roomComposite`, or `participant` is set, matching the egress request type. The nested request bodies are passed through verbatim from the original request. +type EgressDetail struct { + Duration *string `json:"duration,omitempty"` + EgressId *string `json:"egressId,omitempty"` + EndedAt *time.Time `json:"endedAt,omitempty"` + Error *string `json:"error,omitempty"` + FileResults *[]map[string]interface{} `json:"fileResults,omitempty"` + ImageResults *[]map[string]interface{} `json:"imageResults,omitempty"` + Participant *map[string]interface{} `json:"participant,omitempty"` + RoomComposite *map[string]interface{} `json:"roomComposite,omitempty"` + RoomId *string `json:"roomId,omitempty"` + SegmentResults *[]EgressSegmentResult `json:"segmentResults,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + + // Status Egress lifecycle status (mirrors `livekit.EgressStatus`). + Status *EgressStatus `json:"status,omitempty"` + StreamResults *[]map[string]interface{} `json:"streamResults,omitempty"` + Track *map[string]interface{} `json:"track,omitempty"` + TrackComposite *map[string]interface{} `json:"trackComposite,omitempty"` + Type *string `json:"type,omitempty"` + Web *map[string]interface{} `json:"web,omitempty"` +} + +// EgressList defines model for EgressList. +type EgressList struct { + Items []Egress `json:"items"` + + // PageInfo Cursor pagination metadata. + PageInfo PageInfo `json:"pageInfo"` +} + +// EgressSegmentResult defines model for EgressSegmentResult. +type EgressSegmentResult struct { + Duration *string `json:"duration,omitempty"` + EndedAt *string `json:"endedAt,omitempty"` + LivePlaylistLocation *string `json:"livePlaylistLocation,omitempty"` + LivePlaylistName *string `json:"livePlaylistName,omitempty"` + PlaylistLocation *string `json:"playlistLocation,omitempty"` + PlaylistName *string `json:"playlistName,omitempty"` + SegmentCount *string `json:"segmentCount,omitempty"` + Size *string `json:"size,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` +} + +// EgressState defines model for EgressState. +type EgressState string + +// EgressStatus Egress lifecycle status (mirrors `livekit.EgressStatus`). +type EgressStatus string + +// Error defines model for Error. +type Error struct { + Error struct { + Code string `json:"code"` + Message string `json:"message"` + } `json:"error"` +} + +// Export defines model for Export. +type Export struct { + CompletedAt *time.Time `json:"completedAt,omitempty"` + CreatedAt time.Time `json:"createdAt"` + Datasets []ExportDataset `json:"datasets"` + + // DownloadUrl Signed URL to download the artifact. Present when `status` is `completed`. + DownloadUrl *string `json:"downloadUrl,omitempty"` + EndTime *time.Time `json:"endTime,omitempty"` + + // Error Failure detail. Present when `status` is `failed`. + Error *string `json:"error,omitempty"` + + // ExpiresAt When the artifact and its `downloadUrl` expire. + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + FileSizeBytes *string `json:"fileSizeBytes,omitempty"` + Format *ExportFormat `json:"format,omitempty"` + Id string `json:"id"` + ProjectId *string `json:"projectId,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + RowCount *string `json:"rowCount,omitempty"` + StartTime *time.Time `json:"startTime,omitempty"` + Status ExportStatus `json:"status"` +} + +// ExportCreateRequest Describes an export. The project scope is taken from the request path. Optionally narrow to a single record with `resourceId` (with a single dataset). +type ExportCreateRequest struct { + // Datasets Datasets to include. A single dataset yields one file in the chosen `format`; multiple datasets yield a zip archive with one file each. + Datasets []ExportDataset `json:"datasets"` + + // EndTime Exclusive upper bound, RFC3339. + EndTime time.Time `json:"endTime"` + Format *ExportFormat `json:"format,omitempty"` + + // ResourceId Optional. Restrict the export to a single record (e.g. one session or egress id). Requires exactly one dataset. + ResourceId *string `json:"resourceId,omitempty"` + + // StartTime Inclusive lower bound, RFC3339. + StartTime time.Time `json:"startTime"` +} + +// ExportDataset An exportable analytics dataset (values match the URL path segments). +type ExportDataset string + +// ExportFormat defines model for ExportFormat. +type ExportFormat string + +// ExportList defines model for ExportList. +type ExportList struct { + Items []Export `json:"items"` + + // PageInfo Cursor pagination metadata. + PageInfo PageInfo `json:"pageInfo"` +} + +// ExportStatus defines model for ExportStatus. +type ExportStatus string + +// Feature A capability exercised within a session. +type Feature string + +// Ingress defines model for Ingress. +type Ingress struct { + // Duration Duration in seconds. + Duration *string `json:"duration,omitempty"` + EndedAt *time.Time `json:"endedAt,omitempty"` + IngressId *string `json:"ingressId,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + + // Status Ingress endpoint status (mirrors `livekit.IngressState.Status`). + Status *IngressStatus `json:"status,omitempty"` + Tags *[]string `json:"tags,omitempty"` +} + +// IngressDetail defines model for IngressDetail. +type IngressDetail struct { + IngressId *string `json:"ingressId,omitempty"` + Sessions *[]IngressSession `json:"sessions,omitempty"` +} + +// IngressList defines model for IngressList. +type IngressList struct { + Items []Ingress `json:"items"` + + // PageInfo Cursor pagination metadata. + PageInfo PageInfo `json:"pageInfo"` +} + +// IngressSession defines model for IngressSession. +type IngressSession struct { + // Duration Duration in seconds. + Duration *string `json:"duration,omitempty"` + EndedAt *time.Time `json:"endedAt,omitempty"` + Error *string `json:"error,omitempty"` + RoomId *string `json:"roomId,omitempty"` + RoomName *string `json:"roomName,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + Type *string `json:"type,omitempty"` +} + +// IngressStatus Ingress endpoint status (mirrors `livekit.IngressState.Status`). +type IngressStatus string + +// PageInfo Cursor pagination metadata. +type PageInfo struct { + HasMore bool `json:"hasMore"` + + // NextCursor Pass as `cursor` to fetch the next page. Absent on the last page. + NextCursor *string `json:"nextCursor,omitempty"` +} + +// ParticipantInfo defines model for ParticipantInfo. +type ParticipantInfo struct { + Browser *string `json:"browser,omitempty"` + + // ConnectionTimeMs Client connect time in milliseconds. + ConnectionTimeMs *int `json:"connectionTimeMs,omitempty"` + + // ConnectionType Network connection type (e.g. `WIFI`). + ConnectionType *string `json:"connectionType,omitempty"` + DeviceModel *string `json:"deviceModel,omitempty"` + IsActive *bool `json:"isActive,omitempty"` + JoinedAt *time.Time `json:"joinedAt,omitempty"` + LeftAt *time.Time `json:"leftAt,omitempty"` + + // Location Country name. + Location *string `json:"location,omitempty"` + Os *string `json:"os,omitempty"` + ParticipantIdentity *string `json:"participantIdentity,omitempty"` + ParticipantName *string `json:"participantName,omitempty"` + PublishedSources *PublishedSources `json:"publishedSources,omitempty"` + Region *string `json:"region,omitempty"` + RoomId *string `json:"roomId,omitempty"` + SdkVersion *string `json:"sdkVersion,omitempty"` + Sessions *[]ParticipantSession `json:"sessions,omitempty"` +} + +// ParticipantSession defines model for ParticipantSession. +type ParticipantSession struct { + JoinedAt *time.Time `json:"joinedAt,omitempty"` + LeftAt *time.Time `json:"leftAt,omitempty"` + ParticipantId *string `json:"participantId,omitempty"` +} + +// PublishedSources defines model for PublishedSources. +type PublishedSources struct { + CameraTrack *bool `json:"cameraTrack,omitempty"` + MicrophoneTrack *bool `json:"microphoneTrack,omitempty"` + ScreenShareAudio *bool `json:"screenShareAudio,omitempty"` + ScreenShareTrack *bool `json:"screenShareTrack,omitempty"` +} + +// Session defines model for Session. +type Session struct { + // BandwidthIn Bytes received (downstream) over the session. + BandwidthIn *string `json:"bandwidthIn,omitempty"` + + // BandwidthOut Bytes sent (upstream) over the session. + BandwidthOut *string `json:"bandwidthOut,omitempty"` + + // ConnectionCounts Per-session connection counters. + ConnectionCounts *ConnectionCounts `json:"connectionCounts,omitempty"` + + // ConnectionMinutes Total participant connection minutes. + ConnectionMinutes *string `json:"connectionMinutes,omitempty"` + Egress *EgressState `json:"egress,omitempty"` + EndedAt *time.Time `json:"endedAt,omitempty"` + + // Features Capabilities exercised during the session (used by the `feature`/`excludeFeature` filters). + Features *[]Feature `json:"features,omitempty"` + LastActive *time.Time `json:"lastActive,omitempty"` + + // NumActiveParticipants Participants currently connected (0 once the session is closed). + NumActiveParticipants *int `json:"numActiveParticipants,omitempty"` + + // NumParticipants Total participants that joined the session. + NumParticipants *int `json:"numParticipants,omitempty"` + RoomName *string `json:"roomName,omitempty"` + SessionId *string `json:"sessionId,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + Status *SessionStatus `json:"status,omitempty"` + + // Tags User-defined tags on the session (used by the `tag`/`excludeTag` filters). + Tags *[]string `json:"tags,omitempty"` +} + +// SessionDetail Detail for a single session. A superset of `Session`: same field names, plus `roomId` and the per-participant breakdown. +type SessionDetail struct { + // BandwidthIn Bytes received (downstream) over the session. + BandwidthIn *string `json:"bandwidthIn,omitempty"` + + // BandwidthOut Bytes sent (upstream) over the session. + BandwidthOut *string `json:"bandwidthOut,omitempty"` + ConnectionMinutes *string `json:"connectionMinutes,omitempty"` + EndedAt *time.Time `json:"endedAt,omitempty"` + Features *[]Feature `json:"features,omitempty"` + + // NumParticipants Total participants that joined the session. + NumParticipants *int `json:"numParticipants,omitempty"` + Participants *[]ParticipantInfo `json:"participants,omitempty"` + RoomId *string `json:"roomId,omitempty"` + RoomName *string `json:"roomName,omitempty"` + SessionId *string `json:"sessionId,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + Status *SessionStatus `json:"status,omitempty"` + Tags *[]string `json:"tags,omitempty"` +} + +// SessionList defines model for SessionList. +type SessionList struct { + Items []Session `json:"items"` + + // PageInfo Cursor pagination metadata. + PageInfo PageInfo `json:"pageInfo"` +} + +// SessionStatus defines model for SessionStatus. +type SessionStatus string + +// SipAttributes defines model for SipAttributes. +type SipAttributes struct { + CallIdFull *string `json:"callIdFull,omitempty"` + Codec *string `json:"codec,omitempty"` +} + +// SipCall defines model for SipCall. +type SipCall struct { + CallId *string `json:"callId,omitempty"` + Direction *SipDirection `json:"direction,omitempty"` + + // Duration Duration in seconds. + Duration *string `json:"duration,omitempty"` + EndedAt *time.Time `json:"endedAt,omitempty"` + Error *string `json:"error,omitempty"` + RoomId *string `json:"roomId,omitempty"` + RoomName *string `json:"roomName,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + + // Status SIP call status (mirrors `livekit.SIPCallStatus`). + Status *SipCallStatus `json:"status,omitempty"` + Tags *[]string `json:"tags,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +// SipCallDetail defines model for SipCallDetail. +type SipCallDetail struct { + Attributes *SipAttributes `json:"attributes,omitempty"` + CallId *string `json:"callId,omitempty"` + Callee *string `json:"callee,omitempty"` + CalleeHost *string `json:"calleeHost,omitempty"` + Caller *string `json:"caller,omitempty"` + CallerHost *string `json:"callerHost,omitempty"` + Direction *SipDirection `json:"direction,omitempty"` + DispatchId *string `json:"dispatchId,omitempty"` + + // Duration Duration in seconds. + Duration *string `json:"duration,omitempty"` + EndedAt *time.Time `json:"endedAt,omitempty"` + Error *string `json:"error,omitempty"` + Provider *string `json:"provider,omitempty"` + Region *string `json:"region,omitempty"` + + // Response SIP response code. + Response *int `json:"response,omitempty"` + RoomId *string `json:"roomId,omitempty"` + RoomName *string `json:"roomName,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + + // Status SIP call status (mirrors `livekit.SIPCallStatus`). + Status *SipCallStatus `json:"status,omitempty"` + Transport *string `json:"transport,omitempty"` + TrunkId *string `json:"trunkId,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +// SipCallList defines model for SipCallList. +type SipCallList struct { + Items []SipCall `json:"items"` + + // PageInfo Cursor pagination metadata. + PageInfo PageInfo `json:"pageInfo"` +} + +// SipCallStatus SIP call status (mirrors `livekit.SIPCallStatus`). +type SipCallStatus string + +// SipDirection defines model for SipDirection. +type SipDirection string + +// SipEvent defines model for SipEvent. +type SipEvent struct { + // CallInfo Shape is `livekit.SIPCallInfo`. + CallInfo *map[string]interface{} `json:"callInfo,omitempty"` + EventType *SipEventEventType `json:"eventType,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// SipEventEventType defines model for SipEvent.EventType. +type SipEventEventType string + +// SipEventList defines model for SipEventList. +type SipEventList struct { + CallId string `json:"callId"` + Items []SipEvent `json:"items"` + + // PageInfo Cursor pagination metadata. + PageInfo PageInfo `json:"pageInfo"` +} + +// TimeseriesPoint defines model for TimeseriesPoint. +type TimeseriesPoint struct { + Timestamp time.Time `json:"timestamp"` + Value float64 `json:"value"` +} + +// TimeseriesResponse defines model for TimeseriesResponse. +type TimeseriesResponse struct { + Interval TimeseriesResponseInterval `json:"interval"` + Series []TimeseriesSeries `json:"series"` +} + +// TimeseriesResponseInterval defines model for TimeseriesResponse.Interval. +type TimeseriesResponseInterval string + +// TimeseriesSeries defines model for TimeseriesSeries. +type TimeseriesSeries struct { + // Group Dimension values for this series. Present only when `groupBy` is set. + Group *map[string]string `json:"group,omitempty"` + Metric string `json:"metric"` + Points []TimeseriesPoint `json:"points"` +} + +// UsageResponse defines model for UsageResponse. +type UsageResponse struct { + Items []DailyUsage `json:"items"` +} + +// Cursor defines model for Cursor. +type Cursor = string + +// EndTime defines model for EndTime. +type EndTime = time.Time + +// ExcludeFeatures defines model for ExcludeFeatures. +type ExcludeFeatures = []Feature + +// ExcludeTags defines model for ExcludeTags. +type ExcludeTags = []string + +// ExportStatusFilter defines model for ExportStatusFilter. +type ExportStatusFilter = []ExportStatus + +// IncludeFeatures defines model for IncludeFeatures. +type IncludeFeatures = []Feature + +// IncludeTags defines model for IncludeTags. +type IncludeTags = []string + +// Interval defines model for Interval. +type Interval string + +// Limit defines model for Limit. +type Limit = int + +// Metric defines model for Metric. +type Metric = []string + +// Order defines model for Order. +type Order string + +// ProjectId defines model for ProjectId. +type ProjectId = string + +// StartTime defines model for StartTime. +type StartTime = time.Time + +// BadRequest defines model for BadRequest. +type BadRequest = Error + +// Forbidden defines model for Forbidden. +type Forbidden = Error + +// NotFound defines model for NotFound. +type NotFound = Error + +// NotImplemented defines model for NotImplemented. +type NotImplemented = Error + +// TooManyRequests defines model for TooManyRequests. +type TooManyRequests = Error + +// Unauthorized defines model for Unauthorized. +type Unauthorized = Error + +// bearerAuthContextKey is the context key for bearerAuth security scheme +type bearerAuthContextKey string + +// ListProjectEgressesParams defines parameters for ListProjectEgresses. +type ListProjectEgressesParams struct { + // StartTime Inclusive lower bound, RFC3339 (e.g. `2026-07-01T00:00:00Z`). Defaults to 24h before `endTime`. + StartTime *StartTime `form:"startTime,omitempty" json:"startTime,omitempty"` + + // EndTime Exclusive upper bound, RFC3339. Defaults to now. + EndTime *EndTime `form:"endTime,omitempty" json:"endTime,omitempty"` + + // Limit Maximum number of items to return. + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + + // Cursor Opaque pagination token from a previous response's `pageInfo.nextCursor`. Omit to fetch the first page. + Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` + + // Order Sort order. + Order *ListProjectEgressesParamsOrder `form:"order,omitempty" json:"order,omitempty"` + + // Tag Include only records carrying at least one of these tags (OR semantics). Repeat the parameter to pass multiple. + Tag *IncludeTags `form:"tag,omitempty" json:"tag,omitempty"` + + // ExcludeTag Exclude records carrying any of these tags (OR semantics). Repeat the parameter to pass multiple. Combine with `tag` to require some tags while excluding others. + ExcludeTag *ExcludeTags `form:"excludeTag,omitempty" json:"excludeTag,omitempty"` +} + +// ListProjectEgressesParamsOrder defines parameters for ListProjectEgresses. +type ListProjectEgressesParamsOrder string + +// ListProjectExportsParams defines parameters for ListProjectExports. +type ListProjectExportsParams struct { + // Limit Maximum number of items to return. + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + + // Cursor Opaque pagination token from a previous response's `pageInfo.nextCursor`. Omit to fetch the first page. + Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` + + // Status Filter export jobs by status. Repeat the parameter to match multiple. + Status *ExportStatusFilter `form:"status,omitempty" json:"status,omitempty"` +} + +// ListProjectIngressesParams defines parameters for ListProjectIngresses. +type ListProjectIngressesParams struct { + // StartTime Inclusive lower bound, RFC3339 (e.g. `2026-07-01T00:00:00Z`). Defaults to 24h before `endTime`. + StartTime *StartTime `form:"startTime,omitempty" json:"startTime,omitempty"` + + // EndTime Exclusive upper bound, RFC3339. Defaults to now. + EndTime *EndTime `form:"endTime,omitempty" json:"endTime,omitempty"` + + // Limit Maximum number of items to return. + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + + // Cursor Opaque pagination token from a previous response's `pageInfo.nextCursor`. Omit to fetch the first page. + Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` + + // Order Sort order. + Order *ListProjectIngressesParamsOrder `form:"order,omitempty" json:"order,omitempty"` + + // Tag Include only records carrying at least one of these tags (OR semantics). Repeat the parameter to pass multiple. + Tag *IncludeTags `form:"tag,omitempty" json:"tag,omitempty"` + + // ExcludeTag Exclude records carrying any of these tags (OR semantics). Repeat the parameter to pass multiple. Combine with `tag` to require some tags while excluding others. + ExcludeTag *ExcludeTags `form:"excludeTag,omitempty" json:"excludeTag,omitempty"` +} + +// ListProjectIngressesParamsOrder defines parameters for ListProjectIngresses. +type ListProjectIngressesParamsOrder string + +// ListProjectSessionsParams defines parameters for ListProjectSessions. +type ListProjectSessionsParams struct { + // StartTime Inclusive lower bound, RFC3339 (e.g. `2026-07-01T00:00:00Z`). Defaults to 24h before `endTime`. + StartTime *StartTime `form:"startTime,omitempty" json:"startTime,omitempty"` + + // EndTime Exclusive upper bound, RFC3339. Defaults to now. + EndTime *EndTime `form:"endTime,omitempty" json:"endTime,omitempty"` + + // Limit Maximum number of items to return. + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + + // Cursor Opaque pagination token from a previous response's `pageInfo.nextCursor`. Omit to fetch the first page. + Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` + + // Order Sort order. + Order *ListProjectSessionsParamsOrder `form:"order,omitempty" json:"order,omitempty"` + + // Sort Field to sort by. + Sort *ListProjectSessionsParamsSort `form:"sort,omitempty" json:"sort,omitempty"` + + // Status Filter by session status. Repeat the parameter to match multiple. + Status *[]ListProjectSessionsParamsStatus `form:"status,omitempty" json:"status,omitempty"` + + // RoomName Exact room name match. + RoomName *string `form:"roomName,omitempty" json:"roomName,omitempty"` + + // RoomId Exact room (session) id match. + RoomId *string `form:"roomId,omitempty" json:"roomId,omitempty"` + + // Feature Include only records that exercised at least one of these features (OR semantics). Repeat the parameter to pass multiple. + Feature *IncludeFeatures `form:"feature,omitempty" json:"feature,omitempty"` + + // ExcludeFeature Exclude records that exercised any of these features (OR semantics). Repeat the parameter to pass multiple. Example: `excludeFeature=egress&excludeFeature=sip` lists every session that did not use egress or SIP. + ExcludeFeature *ExcludeFeatures `form:"excludeFeature,omitempty" json:"excludeFeature,omitempty"` + + // Tag Include only records carrying at least one of these tags (OR semantics). Repeat the parameter to pass multiple. + Tag *IncludeTags `form:"tag,omitempty" json:"tag,omitempty"` + + // ExcludeTag Exclude records carrying any of these tags (OR semantics). Repeat the parameter to pass multiple. Combine with `tag` to require some tags while excluding others. + ExcludeTag *ExcludeTags `form:"excludeTag,omitempty" json:"excludeTag,omitempty"` +} + +// ListProjectSessionsParamsOrder defines parameters for ListProjectSessions. +type ListProjectSessionsParamsOrder string + +// ListProjectSessionsParamsSort defines parameters for ListProjectSessions. +type ListProjectSessionsParamsSort string + +// ListProjectSessionsParamsStatus defines parameters for ListProjectSessions. +type ListProjectSessionsParamsStatus string + +// ListProjectSipCallsParams defines parameters for ListProjectSipCalls. +type ListProjectSipCallsParams struct { + // StartTime Inclusive lower bound, RFC3339 (e.g. `2026-07-01T00:00:00Z`). Defaults to 24h before `endTime`. + StartTime *StartTime `form:"startTime,omitempty" json:"startTime,omitempty"` + + // EndTime Exclusive upper bound, RFC3339. Defaults to now. + EndTime *EndTime `form:"endTime,omitempty" json:"endTime,omitempty"` + + // Limit Maximum number of items to return. + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + + // Cursor Opaque pagination token from a previous response's `pageInfo.nextCursor`. Omit to fetch the first page. + Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` + + // Order Sort order. + Order *ListProjectSipCallsParamsOrder `form:"order,omitempty" json:"order,omitempty"` + + // Direction Filter by call direction. Repeatable. + Direction *[]ListProjectSipCallsParamsDirection `form:"direction,omitempty" json:"direction,omitempty"` + RoomName *string `form:"roomName,omitempty" json:"roomName,omitempty"` + + // Tag Include only records carrying at least one of these tags (OR semantics). Repeat the parameter to pass multiple. + Tag *IncludeTags `form:"tag,omitempty" json:"tag,omitempty"` + + // ExcludeTag Exclude records carrying any of these tags (OR semantics). Repeat the parameter to pass multiple. Combine with `tag` to require some tags while excluding others. + ExcludeTag *ExcludeTags `form:"excludeTag,omitempty" json:"excludeTag,omitempty"` +} + +// ListProjectSipCallsParamsOrder defines parameters for ListProjectSipCalls. +type ListProjectSipCallsParamsOrder string + +// ListProjectSipCallsParamsDirection defines parameters for ListProjectSipCalls. +type ListProjectSipCallsParamsDirection string + +// ListSipCallEventsParams defines parameters for ListSipCallEvents. +type ListSipCallEventsParams struct { + // StartTime Inclusive lower bound, RFC3339 (e.g. `2026-07-01T00:00:00Z`). Defaults to 24h before `endTime`. + StartTime *StartTime `form:"startTime,omitempty" json:"startTime,omitempty"` + + // EndTime Exclusive upper bound, RFC3339. Defaults to now. + EndTime *EndTime `form:"endTime,omitempty" json:"endTime,omitempty"` + + // Limit Maximum number of items to return. + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + + // Cursor Opaque pagination token from a previous response's `pageInfo.nextCursor`. Omit to fetch the first page. + Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"` + + // Order Sort order. + Order *ListSipCallEventsParamsOrder `form:"order,omitempty" json:"order,omitempty"` + + // EventType Filter by event type. Repeat the parameter to match multiple. + EventType *[]ListSipCallEventsParamsEventType `form:"eventType,omitempty" json:"eventType,omitempty"` +} + +// ListSipCallEventsParamsOrder defines parameters for ListSipCallEvents. +type ListSipCallEventsParamsOrder string + +// ListSipCallEventsParamsEventType defines parameters for ListSipCallEvents. +type ListSipCallEventsParamsEventType string + +// QueryProjectTimeseriesParams defines parameters for QueryProjectTimeseries. +type QueryProjectTimeseriesParams struct { + // StartTime Inclusive lower bound, RFC3339 (e.g. `2026-07-01T00:00:00Z`). Defaults to 24h before `endTime`. + StartTime *StartTime `form:"startTime,omitempty" json:"startTime,omitempty"` + + // EndTime Exclusive upper bound, RFC3339. Defaults to now. + EndTime *EndTime `form:"endTime,omitempty" json:"endTime,omitempty"` + + // Metric One or more metrics to return. Repeat the parameter for multiple. + Metric Metric `form:"metric" json:"metric"` + + // Interval Bucket granularity. + Interval *QueryProjectTimeseriesParamsInterval `form:"interval,omitempty" json:"interval,omitempty"` + + // GroupBy Optional dimension to split each metric by. + GroupBy *QueryProjectTimeseriesParamsGroupBy `form:"groupBy,omitempty" json:"groupBy,omitempty"` + + // SessionId Restrict the series to a single room session. + SessionId *string `form:"sessionId,omitempty" json:"sessionId,omitempty"` +} + +// QueryProjectTimeseriesParamsMetric defines parameters for QueryProjectTimeseries. +type QueryProjectTimeseriesParamsMetric string + +// QueryProjectTimeseriesParamsInterval defines parameters for QueryProjectTimeseries. +type QueryProjectTimeseriesParamsInterval string + +// QueryProjectTimeseriesParamsGroupBy defines parameters for QueryProjectTimeseries. +type QueryProjectTimeseriesParamsGroupBy string + +// GetProjectUsageParams defines parameters for GetProjectUsage. +type GetProjectUsageParams struct { + // StartTime Inclusive lower bound, RFC3339 (e.g. `2026-07-01T00:00:00Z`). Defaults to 24h before `endTime`. + StartTime *StartTime `form:"startTime,omitempty" json:"startTime,omitempty"` + + // EndTime Exclusive upper bound, RFC3339. Defaults to now. + EndTime *EndTime `form:"endTime,omitempty" json:"endTime,omitempty"` +} + +// CreateProjectExportJSONRequestBody defines body for CreateProjectExport for application/json ContentType. +type CreateProjectExportJSONRequestBody = ExportCreateRequest + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // DeleteExport request + DeleteExport(ctx context.Context, exportId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetExport request + GetExport(ctx context.Context, exportId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListProjectEgresses request + ListProjectEgresses(ctx context.Context, projectId ProjectId, params *ListProjectEgressesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEgress request + GetEgress(ctx context.Context, projectId ProjectId, egressId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListProjectExports request + ListProjectExports(ctx context.Context, projectId ProjectId, params *ListProjectExportsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateProjectExportWithBody request with any body + CreateProjectExportWithBody(ctx context.Context, projectId ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateProjectExport(ctx context.Context, projectId ProjectId, body CreateProjectExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListProjectIngresses request + ListProjectIngresses(ctx context.Context, projectId ProjectId, params *ListProjectIngressesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetIngress request + GetIngress(ctx context.Context, projectId ProjectId, ingressId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListProjectSessions request + ListProjectSessions(ctx context.Context, projectId ProjectId, params *ListProjectSessionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSession request + GetSession(ctx context.Context, projectId ProjectId, sessionId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListProjectSipCalls request + ListProjectSipCalls(ctx context.Context, projectId ProjectId, params *ListProjectSipCallsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSipCall request + GetSipCall(ctx context.Context, projectId ProjectId, callId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListSipCallEvents request + ListSipCallEvents(ctx context.Context, projectId ProjectId, callId string, params *ListSipCallEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // QueryProjectTimeseries request + QueryProjectTimeseries(ctx context.Context, projectId ProjectId, params *QueryProjectTimeseriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetProjectUsage request + GetProjectUsage(ctx context.Context, projectId ProjectId, params *GetProjectUsageParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListProjects request + ListProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateProject request + CreateProject(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteProject request + DeleteProject(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetProject request + GetProject(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateProject request + UpdateProject(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListUsers request + ListUsers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetCurrentUser request + GetCurrentUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUser request + GetUser(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListWorkspaces request + ListWorkspaces(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetWorkspace request + GetWorkspace(ctx context.Context, workspaceId string, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) DeleteExport(ctx context.Context, exportId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteExportRequest(c.Server, exportId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetExport(ctx context.Context, exportId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetExportRequest(c.Server, exportId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListProjectEgresses(ctx context.Context, projectId ProjectId, params *ListProjectEgressesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListProjectEgressesRequest(c.Server, projectId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetEgress(ctx context.Context, projectId ProjectId, egressId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEgressRequest(c.Server, projectId, egressId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListProjectExports(ctx context.Context, projectId ProjectId, params *ListProjectExportsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListProjectExportsRequest(c.Server, projectId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateProjectExportWithBody(ctx context.Context, projectId ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateProjectExportRequestWithBody(c.Server, projectId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateProjectExport(ctx context.Context, projectId ProjectId, body CreateProjectExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateProjectExportRequest(c.Server, projectId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListProjectIngresses(ctx context.Context, projectId ProjectId, params *ListProjectIngressesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListProjectIngressesRequest(c.Server, projectId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetIngress(ctx context.Context, projectId ProjectId, ingressId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetIngressRequest(c.Server, projectId, ingressId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListProjectSessions(ctx context.Context, projectId ProjectId, params *ListProjectSessionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListProjectSessionsRequest(c.Server, projectId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetSession(ctx context.Context, projectId ProjectId, sessionId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSessionRequest(c.Server, projectId, sessionId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListProjectSipCalls(ctx context.Context, projectId ProjectId, params *ListProjectSipCallsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListProjectSipCallsRequest(c.Server, projectId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetSipCall(ctx context.Context, projectId ProjectId, callId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSipCallRequest(c.Server, projectId, callId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListSipCallEvents(ctx context.Context, projectId ProjectId, callId string, params *ListSipCallEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListSipCallEventsRequest(c.Server, projectId, callId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) QueryProjectTimeseries(ctx context.Context, projectId ProjectId, params *QueryProjectTimeseriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewQueryProjectTimeseriesRequest(c.Server, projectId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetProjectUsage(ctx context.Context, projectId ProjectId, params *GetProjectUsageParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetProjectUsageRequest(c.Server, projectId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListProjectsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateProject(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateProjectRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteProject(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteProjectRequest(c.Server, projectId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetProject(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetProjectRequest(c.Server, projectId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateProject(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateProjectRequest(c.Server, projectId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListUsers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListUsersRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetCurrentUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetCurrentUserRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetUser(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUserRequest(c.Server, userId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListWorkspaces(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListWorkspacesRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetWorkspace(ctx context.Context, workspaceId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetWorkspaceRequest(c.Server, workspaceId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewDeleteExportRequest generates requests for DeleteExport +func NewDeleteExportRequest(server string, exportId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "exportId", exportId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/exports/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetExportRequest generates requests for GetExport +func NewGetExportRequest(server string, exportId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "exportId", exportId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/exports/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListProjectEgressesRequest generates requests for ListProjectEgresses +func NewListProjectEgressesRequest(server string, projectId ProjectId, params *ListProjectEgressesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/egresses", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "startTime", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endTime", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Order != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "order", *params.Order, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Tag != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tag", *params.Tag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ExcludeTag != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "excludeTag", *params.ExcludeTag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetEgressRequest generates requests for GetEgress +func NewGetEgressRequest(server string, projectId ProjectId, egressId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "egressId", egressId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/egresses/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListProjectExportsRequest generates requests for ListProjectExports +func NewListProjectExportsRequest(server string, projectId ProjectId, params *ListProjectExportsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/exports", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Status != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "status", *params.Status, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateProjectExportRequest calls the generic CreateProjectExport builder with application/json body +func NewCreateProjectExportRequest(server string, projectId ProjectId, body CreateProjectExportJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateProjectExportRequestWithBody(server, projectId, "application/json", bodyReader) +} + +// NewCreateProjectExportRequestWithBody generates requests for CreateProjectExport with any type of body +func NewCreateProjectExportRequestWithBody(server string, projectId ProjectId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/exports", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListProjectIngressesRequest generates requests for ListProjectIngresses +func NewListProjectIngressesRequest(server string, projectId ProjectId, params *ListProjectIngressesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/ingresses", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "startTime", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endTime", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Order != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "order", *params.Order, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Tag != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tag", *params.Tag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ExcludeTag != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "excludeTag", *params.ExcludeTag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetIngressRequest generates requests for GetIngress +func NewGetIngressRequest(server string, projectId ProjectId, ingressId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "ingressId", ingressId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/ingresses/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListProjectSessionsRequest generates requests for ListProjectSessions +func NewListProjectSessionsRequest(server string, projectId ProjectId, params *ListProjectSessionsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/sessions", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "startTime", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endTime", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Order != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "order", *params.Order, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Sort != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sort", *params.Sort, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Status != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "status", *params.Status, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.RoomName != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "roomName", *params.RoomName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.RoomId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "roomId", *params.RoomId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Feature != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "feature", *params.Feature, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ExcludeFeature != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "excludeFeature", *params.ExcludeFeature, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Tag != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tag", *params.Tag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ExcludeTag != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "excludeTag", *params.ExcludeTag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetSessionRequest generates requests for GetSession +func NewGetSessionRequest(server string, projectId ProjectId, sessionId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "sessionId", sessionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/sessions/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListProjectSipCallsRequest generates requests for ListProjectSipCalls +func NewListProjectSipCallsRequest(server string, projectId ProjectId, params *ListProjectSipCallsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/sip-calls", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "startTime", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endTime", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Order != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "order", *params.Order, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Direction != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "direction", *params.Direction, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.RoomName != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "roomName", *params.RoomName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Tag != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tag", *params.Tag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ExcludeTag != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "excludeTag", *params.ExcludeTag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetSipCallRequest generates requests for GetSipCall +func NewGetSipCallRequest(server string, projectId ProjectId, callId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "callId", callId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/sip-calls/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListSipCallEventsRequest generates requests for ListSipCallEvents +func NewListSipCallEventsRequest(server string, projectId ProjectId, callId string, params *ListSipCallEventsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "callId", callId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/sip-calls/%s/events", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "startTime", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endTime", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Order != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "order", *params.Order, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EventType != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "eventType", *params.EventType, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewQueryProjectTimeseriesRequest generates requests for QueryProjectTimeseries +func NewQueryProjectTimeseriesRequest(server string, projectId ProjectId, params *QueryProjectTimeseriesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/timeseries", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "startTime", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endTime", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Metric != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "metric", params.Metric, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "array", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Interval != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "interval", *params.Interval, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.GroupBy != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "groupBy", *params.GroupBy, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.SessionId != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sessionId", *params.SessionId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetProjectUsageRequest generates requests for GetProjectUsage +func NewGetProjectUsageRequest(server string, projectId ProjectId, params *GetProjectUsageParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/analytics/projects/%s/usage", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.StartTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "startTime", *params.StartTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.EndTime != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endTime", *params.EndTime, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListProjectsRequest generates requests for ListProjects +func NewListProjectsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateProjectRequest generates requests for CreateProject +func NewCreateProjectRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteProjectRequest generates requests for DeleteProject +func NewDeleteProjectRequest(server string, projectId ProjectId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetProjectRequest generates requests for GetProject +func NewGetProjectRequest(server string, projectId ProjectId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateProjectRequest generates requests for UpdateProject +func NewUpdateProjectRequest(server string, projectId ProjectId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "projectId", projectId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListUsersRequest generates requests for ListUsers +func NewListUsersRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/users") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetCurrentUserRequest generates requests for GetCurrentUser +func NewGetCurrentUserRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/users/me") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetUserRequest generates requests for GetUser +func NewGetUserRequest(server string, userId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "userId", userId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/users/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListWorkspacesRequest generates requests for ListWorkspaces +func NewListWorkspacesRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/workspaces") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetWorkspaceRequest generates requests for GetWorkspace +func NewGetWorkspaceRequest(server string, workspaceId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "workspaceId", workspaceId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/workspaces/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // DeleteExportWithResponse request + DeleteExportWithResponse(ctx context.Context, exportId string, reqEditors ...RequestEditorFn) (*DeleteExportResponse, error) + + // GetExportWithResponse request + GetExportWithResponse(ctx context.Context, exportId string, reqEditors ...RequestEditorFn) (*GetExportResponse, error) + + // ListProjectEgressesWithResponse request + ListProjectEgressesWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectEgressesParams, reqEditors ...RequestEditorFn) (*ListProjectEgressesResponse, error) + + // GetEgressWithResponse request + GetEgressWithResponse(ctx context.Context, projectId ProjectId, egressId string, reqEditors ...RequestEditorFn) (*GetEgressResponse, error) + + // ListProjectExportsWithResponse request + ListProjectExportsWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectExportsParams, reqEditors ...RequestEditorFn) (*ListProjectExportsResponse, error) + + // CreateProjectExportWithBodyWithResponse request with any body + CreateProjectExportWithBodyWithResponse(ctx context.Context, projectId ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectExportResponse, error) + + CreateProjectExportWithResponse(ctx context.Context, projectId ProjectId, body CreateProjectExportJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectExportResponse, error) + + // ListProjectIngressesWithResponse request + ListProjectIngressesWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectIngressesParams, reqEditors ...RequestEditorFn) (*ListProjectIngressesResponse, error) + + // GetIngressWithResponse request + GetIngressWithResponse(ctx context.Context, projectId ProjectId, ingressId string, reqEditors ...RequestEditorFn) (*GetIngressResponse, error) + + // ListProjectSessionsWithResponse request + ListProjectSessionsWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectSessionsParams, reqEditors ...RequestEditorFn) (*ListProjectSessionsResponse, error) + + // GetSessionWithResponse request + GetSessionWithResponse(ctx context.Context, projectId ProjectId, sessionId string, reqEditors ...RequestEditorFn) (*GetSessionResponse, error) + + // ListProjectSipCallsWithResponse request + ListProjectSipCallsWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectSipCallsParams, reqEditors ...RequestEditorFn) (*ListProjectSipCallsResponse, error) + + // GetSipCallWithResponse request + GetSipCallWithResponse(ctx context.Context, projectId ProjectId, callId string, reqEditors ...RequestEditorFn) (*GetSipCallResponse, error) + + // ListSipCallEventsWithResponse request + ListSipCallEventsWithResponse(ctx context.Context, projectId ProjectId, callId string, params *ListSipCallEventsParams, reqEditors ...RequestEditorFn) (*ListSipCallEventsResponse, error) + + // QueryProjectTimeseriesWithResponse request + QueryProjectTimeseriesWithResponse(ctx context.Context, projectId ProjectId, params *QueryProjectTimeseriesParams, reqEditors ...RequestEditorFn) (*QueryProjectTimeseriesResponse, error) + + // GetProjectUsageWithResponse request + GetProjectUsageWithResponse(ctx context.Context, projectId ProjectId, params *GetProjectUsageParams, reqEditors ...RequestEditorFn) (*GetProjectUsageResponse, error) + + // ListProjectsWithResponse request + ListProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListProjectsResponse, error) + + // CreateProjectWithResponse request + CreateProjectWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) + + // DeleteProjectWithResponse request + DeleteProjectWithResponse(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*DeleteProjectResponse, error) + + // GetProjectWithResponse request + GetProjectWithResponse(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*GetProjectResponse, error) + + // UpdateProjectWithResponse request + UpdateProjectWithResponse(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*UpdateProjectResponse, error) + + // ListUsersWithResponse request + ListUsersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListUsersResponse, error) + + // GetCurrentUserWithResponse request + GetCurrentUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCurrentUserResponse, error) + + // GetUserWithResponse request + GetUserWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetUserResponse, error) + + // ListWorkspacesWithResponse request + ListWorkspacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWorkspacesResponse, error) + + // GetWorkspaceWithResponse request + GetWorkspaceWithResponse(ctx context.Context, workspaceId string, reqEditors ...RequestEditorFn) (*GetWorkspaceResponse, error) +} + +type DeleteExportResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Unauthorized + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r DeleteExportResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteExportResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteExportResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetExportResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Export + JSON401 *Unauthorized + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r GetExportResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetExportResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetExportResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListProjectEgressesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EgressList + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r ListProjectEgressesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListProjectEgressesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListProjectEgressesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetEgressResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EgressDetail + JSON401 *Unauthorized + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r GetEgressResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEgressResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetEgressResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListProjectExportsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ExportList + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r ListProjectExportsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListProjectExportsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListProjectExportsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type CreateProjectExportResponse struct { + Body []byte + HTTPResponse *http.Response + JSON202 *Export + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r CreateProjectExportResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateProjectExportResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r CreateProjectExportResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListProjectIngressesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *IngressList + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r ListProjectIngressesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListProjectIngressesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListProjectIngressesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetIngressResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *IngressDetail + JSON401 *Unauthorized + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r GetIngressResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetIngressResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetIngressResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListProjectSessionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SessionList + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r ListProjectSessionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListProjectSessionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListProjectSessionsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetSessionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SessionDetail + JSON401 *Unauthorized + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r GetSessionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSessionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetSessionResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListProjectSipCallsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SipCallList + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r ListProjectSipCallsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListProjectSipCallsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListProjectSipCallsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetSipCallResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SipCallDetail + JSON401 *Unauthorized + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r GetSipCallResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSipCallResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetSipCallResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListSipCallEventsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SipEventList + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r ListSipCallEventsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListSipCallEventsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListSipCallEventsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type QueryProjectTimeseriesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *TimeseriesResponse + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r QueryProjectTimeseriesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r QueryProjectTimeseriesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r QueryProjectTimeseriesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetProjectUsageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UsageResponse + JSON400 *BadRequest + JSON401 *Unauthorized + JSON403 *Forbidden + JSON429 *TooManyRequests +} + +// Status returns HTTPResponse.Status +func (r GetProjectUsageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetProjectUsageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetProjectUsageResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListProjectsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r ListProjectsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListProjectsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListProjectsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type CreateProjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r CreateProjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateProjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r CreateProjectResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type DeleteProjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r DeleteProjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteProjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteProjectResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetProjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r GetProjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetProjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetProjectResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type UpdateProjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r UpdateProjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateProjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r UpdateProjectResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListUsersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r ListUsersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListUsersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListUsersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetCurrentUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r GetCurrentUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetCurrentUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetCurrentUserResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r GetUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetUserResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListWorkspacesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r ListWorkspacesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListWorkspacesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListWorkspacesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetWorkspaceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON501 *NotImplemented +} + +// Status returns HTTPResponse.Status +func (r GetWorkspaceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetWorkspaceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetWorkspaceResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +// DeleteExportWithResponse request returning *DeleteExportResponse +func (c *ClientWithResponses) DeleteExportWithResponse(ctx context.Context, exportId string, reqEditors ...RequestEditorFn) (*DeleteExportResponse, error) { + rsp, err := c.DeleteExport(ctx, exportId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteExportResponse(rsp) +} + +// GetExportWithResponse request returning *GetExportResponse +func (c *ClientWithResponses) GetExportWithResponse(ctx context.Context, exportId string, reqEditors ...RequestEditorFn) (*GetExportResponse, error) { + rsp, err := c.GetExport(ctx, exportId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetExportResponse(rsp) +} + +// ListProjectEgressesWithResponse request returning *ListProjectEgressesResponse +func (c *ClientWithResponses) ListProjectEgressesWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectEgressesParams, reqEditors ...RequestEditorFn) (*ListProjectEgressesResponse, error) { + rsp, err := c.ListProjectEgresses(ctx, projectId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListProjectEgressesResponse(rsp) +} + +// GetEgressWithResponse request returning *GetEgressResponse +func (c *ClientWithResponses) GetEgressWithResponse(ctx context.Context, projectId ProjectId, egressId string, reqEditors ...RequestEditorFn) (*GetEgressResponse, error) { + rsp, err := c.GetEgress(ctx, projectId, egressId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEgressResponse(rsp) +} + +// ListProjectExportsWithResponse request returning *ListProjectExportsResponse +func (c *ClientWithResponses) ListProjectExportsWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectExportsParams, reqEditors ...RequestEditorFn) (*ListProjectExportsResponse, error) { + rsp, err := c.ListProjectExports(ctx, projectId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListProjectExportsResponse(rsp) +} + +// CreateProjectExportWithBodyWithResponse request with arbitrary body returning *CreateProjectExportResponse +func (c *ClientWithResponses) CreateProjectExportWithBodyWithResponse(ctx context.Context, projectId ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectExportResponse, error) { + rsp, err := c.CreateProjectExportWithBody(ctx, projectId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateProjectExportResponse(rsp) +} + +func (c *ClientWithResponses) CreateProjectExportWithResponse(ctx context.Context, projectId ProjectId, body CreateProjectExportJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectExportResponse, error) { + rsp, err := c.CreateProjectExport(ctx, projectId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateProjectExportResponse(rsp) +} + +// ListProjectIngressesWithResponse request returning *ListProjectIngressesResponse +func (c *ClientWithResponses) ListProjectIngressesWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectIngressesParams, reqEditors ...RequestEditorFn) (*ListProjectIngressesResponse, error) { + rsp, err := c.ListProjectIngresses(ctx, projectId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListProjectIngressesResponse(rsp) +} + +// GetIngressWithResponse request returning *GetIngressResponse +func (c *ClientWithResponses) GetIngressWithResponse(ctx context.Context, projectId ProjectId, ingressId string, reqEditors ...RequestEditorFn) (*GetIngressResponse, error) { + rsp, err := c.GetIngress(ctx, projectId, ingressId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetIngressResponse(rsp) +} + +// ListProjectSessionsWithResponse request returning *ListProjectSessionsResponse +func (c *ClientWithResponses) ListProjectSessionsWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectSessionsParams, reqEditors ...RequestEditorFn) (*ListProjectSessionsResponse, error) { + rsp, err := c.ListProjectSessions(ctx, projectId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListProjectSessionsResponse(rsp) +} + +// GetSessionWithResponse request returning *GetSessionResponse +func (c *ClientWithResponses) GetSessionWithResponse(ctx context.Context, projectId ProjectId, sessionId string, reqEditors ...RequestEditorFn) (*GetSessionResponse, error) { + rsp, err := c.GetSession(ctx, projectId, sessionId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSessionResponse(rsp) +} + +// ListProjectSipCallsWithResponse request returning *ListProjectSipCallsResponse +func (c *ClientWithResponses) ListProjectSipCallsWithResponse(ctx context.Context, projectId ProjectId, params *ListProjectSipCallsParams, reqEditors ...RequestEditorFn) (*ListProjectSipCallsResponse, error) { + rsp, err := c.ListProjectSipCalls(ctx, projectId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListProjectSipCallsResponse(rsp) +} + +// GetSipCallWithResponse request returning *GetSipCallResponse +func (c *ClientWithResponses) GetSipCallWithResponse(ctx context.Context, projectId ProjectId, callId string, reqEditors ...RequestEditorFn) (*GetSipCallResponse, error) { + rsp, err := c.GetSipCall(ctx, projectId, callId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSipCallResponse(rsp) +} + +// ListSipCallEventsWithResponse request returning *ListSipCallEventsResponse +func (c *ClientWithResponses) ListSipCallEventsWithResponse(ctx context.Context, projectId ProjectId, callId string, params *ListSipCallEventsParams, reqEditors ...RequestEditorFn) (*ListSipCallEventsResponse, error) { + rsp, err := c.ListSipCallEvents(ctx, projectId, callId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListSipCallEventsResponse(rsp) +} + +// QueryProjectTimeseriesWithResponse request returning *QueryProjectTimeseriesResponse +func (c *ClientWithResponses) QueryProjectTimeseriesWithResponse(ctx context.Context, projectId ProjectId, params *QueryProjectTimeseriesParams, reqEditors ...RequestEditorFn) (*QueryProjectTimeseriesResponse, error) { + rsp, err := c.QueryProjectTimeseries(ctx, projectId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseQueryProjectTimeseriesResponse(rsp) +} + +// GetProjectUsageWithResponse request returning *GetProjectUsageResponse +func (c *ClientWithResponses) GetProjectUsageWithResponse(ctx context.Context, projectId ProjectId, params *GetProjectUsageParams, reqEditors ...RequestEditorFn) (*GetProjectUsageResponse, error) { + rsp, err := c.GetProjectUsage(ctx, projectId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProjectUsageResponse(rsp) +} + +// ListProjectsWithResponse request returning *ListProjectsResponse +func (c *ClientWithResponses) ListProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListProjectsResponse, error) { + rsp, err := c.ListProjects(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListProjectsResponse(rsp) +} + +// CreateProjectWithResponse request returning *CreateProjectResponse +func (c *ClientWithResponses) CreateProjectWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) { + rsp, err := c.CreateProject(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateProjectResponse(rsp) +} + +// DeleteProjectWithResponse request returning *DeleteProjectResponse +func (c *ClientWithResponses) DeleteProjectWithResponse(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*DeleteProjectResponse, error) { + rsp, err := c.DeleteProject(ctx, projectId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteProjectResponse(rsp) +} + +// GetProjectWithResponse request returning *GetProjectResponse +func (c *ClientWithResponses) GetProjectWithResponse(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*GetProjectResponse, error) { + rsp, err := c.GetProject(ctx, projectId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProjectResponse(rsp) +} + +// UpdateProjectWithResponse request returning *UpdateProjectResponse +func (c *ClientWithResponses) UpdateProjectWithResponse(ctx context.Context, projectId ProjectId, reqEditors ...RequestEditorFn) (*UpdateProjectResponse, error) { + rsp, err := c.UpdateProject(ctx, projectId, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateProjectResponse(rsp) +} + +// ListUsersWithResponse request returning *ListUsersResponse +func (c *ClientWithResponses) ListUsersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListUsersResponse, error) { + rsp, err := c.ListUsers(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListUsersResponse(rsp) +} + +// GetCurrentUserWithResponse request returning *GetCurrentUserResponse +func (c *ClientWithResponses) GetCurrentUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCurrentUserResponse, error) { + rsp, err := c.GetCurrentUser(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetCurrentUserResponse(rsp) +} + +// GetUserWithResponse request returning *GetUserResponse +func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetUserResponse, error) { + rsp, err := c.GetUser(ctx, userId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUserResponse(rsp) +} + +// ListWorkspacesWithResponse request returning *ListWorkspacesResponse +func (c *ClientWithResponses) ListWorkspacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWorkspacesResponse, error) { + rsp, err := c.ListWorkspaces(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListWorkspacesResponse(rsp) +} + +// GetWorkspaceWithResponse request returning *GetWorkspaceResponse +func (c *ClientWithResponses) GetWorkspaceWithResponse(ctx context.Context, workspaceId string, reqEditors ...RequestEditorFn) (*GetWorkspaceResponse, error) { + rsp, err := c.GetWorkspace(ctx, workspaceId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetWorkspaceResponse(rsp) +} + +// ParseDeleteExportResponse parses an HTTP response from a DeleteExportWithResponse call +func ParseDeleteExportResponse(rsp *http.Response) (*DeleteExportResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteExportResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseGetExportResponse parses an HTTP response from a GetExportWithResponse call +func ParseGetExportResponse(rsp *http.Response) (*GetExportResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetExportResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Export + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseListProjectEgressesResponse parses an HTTP response from a ListProjectEgressesWithResponse call +func ParseListProjectEgressesResponse(rsp *http.Response) (*ListProjectEgressesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListProjectEgressesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest EgressList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseGetEgressResponse parses an HTTP response from a GetEgressWithResponse call +func ParseGetEgressResponse(rsp *http.Response) (*GetEgressResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetEgressResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest EgressDetail + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseListProjectExportsResponse parses an HTTP response from a ListProjectExportsWithResponse call +func ParseListProjectExportsResponse(rsp *http.Response) (*ListProjectExportsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListProjectExportsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ExportList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseCreateProjectExportResponse parses an HTTP response from a CreateProjectExportWithResponse call +func ParseCreateProjectExportResponse(rsp *http.Response) (*CreateProjectExportResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateProjectExportResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Export + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON202 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseListProjectIngressesResponse parses an HTTP response from a ListProjectIngressesWithResponse call +func ParseListProjectIngressesResponse(rsp *http.Response) (*ListProjectIngressesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListProjectIngressesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest IngressList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseGetIngressResponse parses an HTTP response from a GetIngressWithResponse call +func ParseGetIngressResponse(rsp *http.Response) (*GetIngressResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetIngressResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest IngressDetail + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseListProjectSessionsResponse parses an HTTP response from a ListProjectSessionsWithResponse call +func ParseListProjectSessionsResponse(rsp *http.Response) (*ListProjectSessionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListProjectSessionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SessionList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseGetSessionResponse parses an HTTP response from a GetSessionWithResponse call +func ParseGetSessionResponse(rsp *http.Response) (*GetSessionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSessionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SessionDetail + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseListProjectSipCallsResponse parses an HTTP response from a ListProjectSipCallsWithResponse call +func ParseListProjectSipCallsResponse(rsp *http.Response) (*ListProjectSipCallsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListProjectSipCallsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SipCallList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseGetSipCallResponse parses an HTTP response from a GetSipCallWithResponse call +func ParseGetSipCallResponse(rsp *http.Response) (*GetSipCallResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSipCallResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SipCallDetail + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseListSipCallEventsResponse parses an HTTP response from a ListSipCallEventsWithResponse call +func ParseListSipCallEventsResponse(rsp *http.Response) (*ListSipCallEventsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListSipCallEventsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SipEventList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseQueryProjectTimeseriesResponse parses an HTTP response from a QueryProjectTimeseriesWithResponse call +func ParseQueryProjectTimeseriesResponse(rsp *http.Response) (*QueryProjectTimeseriesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &QueryProjectTimeseriesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest TimeseriesResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseGetProjectUsageResponse parses an HTTP response from a GetProjectUsageWithResponse call +func ParseGetProjectUsageResponse(rsp *http.Response) (*GetProjectUsageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetProjectUsageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UsageResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Unauthorized + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + } + + return response, nil +} + +// ParseListProjectsResponse parses an HTTP response from a ListProjectsWithResponse call +func ParseListProjectsResponse(rsp *http.Response) (*ListProjectsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListProjectsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseCreateProjectResponse parses an HTTP response from a CreateProjectWithResponse call +func ParseCreateProjectResponse(rsp *http.Response) (*CreateProjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateProjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseDeleteProjectResponse parses an HTTP response from a DeleteProjectWithResponse call +func ParseDeleteProjectResponse(rsp *http.Response) (*DeleteProjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteProjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseGetProjectResponse parses an HTTP response from a GetProjectWithResponse call +func ParseGetProjectResponse(rsp *http.Response) (*GetProjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetProjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseUpdateProjectResponse parses an HTTP response from a UpdateProjectWithResponse call +func ParseUpdateProjectResponse(rsp *http.Response) (*UpdateProjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateProjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseListUsersResponse parses an HTTP response from a ListUsersWithResponse call +func ParseListUsersResponse(rsp *http.Response) (*ListUsersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListUsersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseGetCurrentUserResponse parses an HTTP response from a GetCurrentUserWithResponse call +func ParseGetCurrentUserResponse(rsp *http.Response) (*GetCurrentUserResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetCurrentUserResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseGetUserResponse parses an HTTP response from a GetUserWithResponse call +func ParseGetUserResponse(rsp *http.Response) (*GetUserResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetUserResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseListWorkspacesResponse parses an HTTP response from a ListWorkspacesWithResponse call +func ParseListWorkspacesResponse(rsp *http.Response) (*ListWorkspacesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListWorkspacesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseGetWorkspaceResponse parses an HTTP response from a GetWorkspaceWithResponse call +func ParseGetWorkspaceResponse(rsp *http.Response) (*GetWorkspaceResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetWorkspaceResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest NotImplemented + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +}