From ec3a9312b864f6cbc1ff219d3a4f1591576a948c Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Mon, 27 Apr 2026 09:46:58 +0200 Subject: [PATCH 1/5] build: test code generation --- Makefile | 5 + go.mod | 5 +- go.sum | 12 +- pkg/renkuapi/session/session_gen.go | 3741 --------------------------- pkg/renkuapi/users/users_gen.go | 2597 ------------------- 5 files changed, 9 insertions(+), 6351 deletions(-) delete mode 100644 pkg/renkuapi/session/session_gen.go delete mode 100644 pkg/renkuapi/users/users_gen.go diff --git a/Makefile b/Makefile index d2fa16e..52867da 100644 --- a/Makefile +++ b/Makefile @@ -93,3 +93,8 @@ pkg/renkuapi/users/users_gen.go: pkg/renkuapi/users/api.spec.yaml pkg/renkuapi/session/session_gen.go: pkg/renkuapi/session/api.spec.yaml go generate pkg/renkuapi/session/session.go + +.PHONY: cleanup-generate +cleanup-generate: ## Remove generated files + rm pkg/renkuapi/users/users_gen.go + rm pkg/renkuapi/session/session_gen.go diff --git a/go.mod b/go.mod index 6a60ab0..1523dda 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,7 @@ require ( github.com/containerd/containerd/v2 v2.2.3 github.com/distribution/distribution/v3 v3.1.0 github.com/distribution/reference v0.6.0 - github.com/getkin/kin-openapi v0.135.0 github.com/golang-jwt/jwt/v5 v5.3.1 - github.com/oapi-codegen/runtime v1.4.0 github.com/opencontainers/image-spec v1.1.1 github.com/spf13/cobra v1.10.2 github.com/spf13/viper v1.21.0 @@ -24,7 +22,6 @@ require ( ) require ( - github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/typeurl/v2 v2.2.3 // indirect @@ -35,6 +32,7 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/getkin/kin-openapi v0.133.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -69,6 +67,7 @@ require ( github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect github.com/woodsbury/decimal128 v1.3.0 // indirect github.com/x448/float16 v0.8.4 // indirect diff --git a/go.sum b/go.sum index a56553d..f1df462 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,3 @@ -github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= -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/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -40,8 +36,8 @@ github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= 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/getkin/kin-openapi v0.135.0 h1:751SjYfbiwqukYuVjwYEIKNfrSwS5YpA7DZnKSwQgtg= -github.com/getkin/kin-openapi v0.135.0/go.mod h1:6dd5FJl6RdX4usBtFBaQhk9q62Yb2J0Mk5IhUO/QqFI= +github.com/getkin/kin-openapi v0.133.0 h1:pJdmNohVIJ97r4AUFtEXRXwESr8b0bD721u/Tz6k8PQ= +github.com/getkin/kin-openapi v0.133.0/go.mod h1:boAciF6cXk5FhPqe/NQeBTeenbjqU4LhWBf09ILVvWE= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -95,7 +91,6 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -123,8 +118,6 @@ 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/oapi-codegen/v2 v2.6.0 h1:4i+F2cvwBFZeplxCssNdLy3MhNzUD87mI3HnayHZkAU= github.com/oapi-codegen/oapi-codegen/v2 v2.6.0/go.mod h1:eWHeJSohQJIINJZzzQriVynfGsnlQVh0UkN2UYYcw4Q= -github.com/oapi-codegen/runtime v1.4.0 h1:KLOSFOp7UzkbS7Cs1ms6NBEKYr0WmH2wZG0KKbd2er4= -github.com/oapi-codegen/runtime v1.4.0/go.mod h1:5sw5fxCDmnOzKNYmkVNF8d34kyUeejJEY8HNT2WaPec= 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= @@ -178,7 +171,6 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= -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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= diff --git a/pkg/renkuapi/session/session_gen.go b/pkg/renkuapi/session/session_gen.go deleted file mode 100644 index 500816d..0000000 --- a/pkg/renkuapi/session/session_gen.go +++ /dev/null @@ -1,3741 +0,0 @@ -// Package session provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT. -package session - -import ( - "bytes" - "compress/gzip" - "context" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "path" - "strings" - "time" - - "github.com/getkin/kin-openapi/openapi3" - "github.com/oapi-codegen/runtime" -) - -// Defines values for BuildCompletedPartStatus. -const ( - Succeeded BuildCompletedPartStatus = "succeeded" -) - -// Valid indicates whether the value is a known member of the BuildCompletedPartStatus enum. -func (e BuildCompletedPartStatus) Valid() bool { - switch e { - case Succeeded: - return true - default: - return false - } -} - -// Defines values for BuildNotCompletedPartStatus. -const ( - BuildNotCompletedPartStatusCancelled BuildNotCompletedPartStatus = "cancelled" - BuildNotCompletedPartStatusFailed BuildNotCompletedPartStatus = "failed" - BuildNotCompletedPartStatusInProgress BuildNotCompletedPartStatus = "in_progress" -) - -// Valid indicates whether the value is a known member of the BuildNotCompletedPartStatus enum. -func (e BuildNotCompletedPartStatus) Valid() bool { - switch e { - case BuildNotCompletedPartStatusCancelled: - return true - case BuildNotCompletedPartStatusFailed: - return true - case BuildNotCompletedPartStatusInProgress: - return true - default: - return false - } -} - -// Defines values for BuildPatchStatus. -const ( - BuildPatchStatusCancelled BuildPatchStatus = "cancelled" -) - -// Valid indicates whether the value is a known member of the BuildPatchStatus enum. -func (e BuildPatchStatus) Valid() bool { - switch e { - case BuildPatchStatusCancelled: - return true - default: - return false - } -} - -// Defines values for BuildPlatform. -const ( - Linuxamd64 BuildPlatform = "linux/amd64" - Linuxarm64 BuildPlatform = "linux/arm64" -) - -// Valid indicates whether the value is a known member of the BuildPlatform enum. -func (e BuildPlatform) Valid() bool { - switch e { - case Linuxamd64: - return true - case Linuxarm64: - return true - default: - return false - } -} - -// Defines values for EnvironmentImageSourceBuild. -const ( - EnvironmentImageSourceBuildBuild EnvironmentImageSourceBuild = "build" -) - -// Valid indicates whether the value is a known member of the EnvironmentImageSourceBuild enum. -func (e EnvironmentImageSourceBuild) Valid() bool { - switch e { - case EnvironmentImageSourceBuildBuild: - return true - default: - return false - } -} - -// Defines values for EnvironmentImageSourceImage. -const ( - Image EnvironmentImageSourceImage = "image" -) - -// Valid indicates whether the value is a known member of the EnvironmentImageSourceImage enum. -func (e EnvironmentImageSourceImage) Valid() bool { - switch e { - case Image: - return true - default: - return false - } -} - -// Defines values for EnvironmentKind. -const ( - CUSTOM EnvironmentKind = "CUSTOM" - GLOBAL EnvironmentKind = "GLOBAL" -) - -// Valid indicates whether the value is a known member of the EnvironmentKind enum. -func (e EnvironmentKind) Valid() bool { - switch e { - case CUSTOM: - return true - case GLOBAL: - return true - default: - return false - } -} - -// Build defines model for Build. -type Build struct { - // CreatedAt The date and time the resource was created (in UTC and ISO-8601 format) - CreatedAt CreationDate `json:"created_at"` - - // EnvironmentId ULID identifier - EnvironmentId Ulid `json:"environment_id"` - - // ErrorReason The reason why a container image build did not succeed, if available. - ErrorReason *ErrorReason `json:"error_reason,omitempty"` - - // Id ULID identifier - Id Ulid `json:"id"` - union json.RawMessage -} - -// BuildCommonPart defines model for BuildCommonPart. -type BuildCommonPart struct { - // CreatedAt The date and time the resource was created (in UTC and ISO-8601 format) - CreatedAt CreationDate `json:"created_at"` - - // EnvironmentId ULID identifier - EnvironmentId Ulid `json:"environment_id"` - - // ErrorReason The reason why a container image build did not succeed, if available. - ErrorReason *ErrorReason `json:"error_reason,omitempty"` - - // Id ULID identifier - Id Ulid `json:"id"` -} - -// BuildCompletedPart defines model for BuildCompletedPart. -type BuildCompletedPart struct { - // Result The result of a container image build - Result BuildResult `json:"result"` - Status BuildCompletedPartStatus `json:"status"` -} - -// BuildCompletedPartStatus defines model for BuildCompletedPart.Status. -type BuildCompletedPartStatus string - -// BuildContextDir The relative path to a folder -type BuildContextDir = string - -// BuildContextDirPatch The relative path to a folder -type BuildContextDirPatch = string - -// BuildList A list of container image builds -type BuildList = []Build - -// BuildLogs The logs of a container image build -type BuildLogs map[string]string - -// BuildNotCompletedPart defines model for BuildNotCompletedPart. -type BuildNotCompletedPart struct { - Status BuildNotCompletedPartStatus `json:"status"` -} - -// BuildNotCompletedPartStatus defines model for BuildNotCompletedPart.Status. -type BuildNotCompletedPartStatus string - -// BuildParameters Build parameters -type BuildParameters struct { - // BuilderVariant Type of virtual environment manager when building custom environments. - BuilderVariant BuilderVariant `json:"builder_variant"` - - // ContextDir The relative path to a folder - ContextDir *BuildContextDir `json:"context_dir,omitempty"` - - // FrontendVariant User's Frontend Choice. - FrontendVariant FrontendVariant `json:"frontend_variant"` - - // Platforms The target runtime platforms of a session environment. - Platforms *BuildPlatforms `json:"platforms,omitempty"` - - // Repository A git repository URL - Repository Repository `json:"repository"` - - // RepositoryRevision A git revision - RepositoryRevision *RepositoryRevision `json:"repository_revision,omitempty"` -} - -// BuildParametersPatch Data for updating a build -type BuildParametersPatch struct { - // BuilderVariant Type of virtual environment manager when building custom environments. - BuilderVariant *BuilderVariant `json:"builder_variant,omitempty"` - - // ContextDir The relative path to a folder - ContextDir *BuildContextDirPatch `json:"context_dir,omitempty"` - - // FrontendVariant User's Frontend Choice. - FrontendVariant *FrontendVariant `json:"frontend_variant,omitempty"` - - // Platforms The target runtime platforms of a session environment. - Platforms *BuildPlatforms `json:"platforms,omitempty"` - - // Repository A git repository URL - Repository *Repository `json:"repository,omitempty"` - - // RepositoryRevision A git revision - RepositoryRevision *RepositoryRevisionPatch `json:"repository_revision,omitempty"` -} - -// BuildParametersPost defines model for BuildParametersPost. -type BuildParametersPost struct { - // BuilderVariant Type of virtual environment manager when building custom environments. - BuilderVariant BuilderVariant `json:"builder_variant"` - - // ContextDir The relative path to a folder - ContextDir *BuildContextDir `json:"context_dir,omitempty"` - EnvironmentImageSource EnvironmentImageSourceBuild `json:"environment_image_source"` - - // FrontendVariant User's Frontend Choice. - FrontendVariant FrontendVariant `json:"frontend_variant"` - - // Platforms The target runtime platforms of a session environment. - Platforms *BuildPlatforms `json:"platforms,omitempty"` - - // Repository A git repository URL - Repository Repository `json:"repository"` - - // RepositoryRevision A git revision - RepositoryRevision *RepositoryRevision `json:"repository_revision,omitempty"` -} - -// BuildPatch The requested update of a container image build -type BuildPatch struct { - Status *BuildPatchStatus `json:"status,omitempty"` -} - -// BuildPatchStatus defines model for BuildPatch.Status. -type BuildPatchStatus string - -// BuildPlatform A runtime platform, e.g. "linux/amd64". -type BuildPlatform string - -// BuildPlatforms The target runtime platforms of a session environment. -type BuildPlatforms = []BuildPlatform - -// BuildResult The result of a container image build -type BuildResult struct { - // CompletedAt The date and time the resource was created (in UTC and ISO-8601 format) - CompletedAt CreationDate `json:"completed_at"` - - // Image A container image - Image ContainerImage `json:"image"` - RepositoryGitCommitSha string `json:"repository_git_commit_sha"` - RepositoryUrl string `json:"repository_url"` -} - -// BuilderVariant Type of virtual environment manager when building custom environments. -type BuilderVariant = string - -// ContainerImage A container image -type ContainerImage = string - -// CreationDate The date and time the resource was created (in UTC and ISO-8601 format) -type CreationDate = time.Time - -// DefaultUrl The default path to open in a session -type DefaultUrl = string - -// Description A description for the resource -type Description = string - -// DiskStorage The size of disk storage for the session, in gigabytes -type DiskStorage = int - -// DiskStoragePatch defines model for DiskStoragePatch. -type DiskStoragePatch = int - -// EnvVar An environment variable for the session pod -type EnvVar struct { - Name string `json:"name"` - Value *string `json:"value,omitempty"` -} - -// EnvVariables Environment variables for the session pod -type EnvVariables = []EnvVar - -// Environment defines model for Environment. -type Environment struct { - // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes - Args *EnvironmentArgs `json:"args,omitempty"` - - // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes - Command *EnvironmentCommand `json:"command,omitempty"` - - // ContainerImage A container image - ContainerImage ContainerImage `json:"container_image"` - - // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) - CreationDate CreationDate `json:"creation_date"` - - // DefaultUrl The default path to open in a session - DefaultUrl DefaultUrl `json:"default_url"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - - // Gid The group ID used to run the session - Gid EnvironmentGid `json:"gid"` - - // Id ULID identifier - Id Ulid `json:"id"` - - // IsArchived Whether this environment is archived and not for use in new projects or not - IsArchived *IsArchived `json:"is_archived,omitempty"` - - // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. - MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` - - // Name Renku session name - Name SessionName `json:"name"` - - // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress - Port EnvironmentPort `json:"port"` - StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` - - // Uid The user ID used to run the session - Uid EnvironmentUid `json:"uid"` - - // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. - WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` -} - -// EnvironmentArgs The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes -type EnvironmentArgs = []string - -// EnvironmentCommand The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes -type EnvironmentCommand = []string - -// EnvironmentGetInLauncher defines model for EnvironmentGetInLauncher. -type EnvironmentGetInLauncher struct { - union json.RawMessage -} - -// EnvironmentGid The group ID used to run the session -type EnvironmentGid = int - -// EnvironmentId Id of the environment to use -type EnvironmentId = string - -// EnvironmentIdOnlyPatch defines model for EnvironmentIdOnlyPatch. -type EnvironmentIdOnlyPatch struct { - // Id Id of the environment to use - Id *EnvironmentId `json:"id,omitempty"` -} - -// EnvironmentIdOnlyPost defines model for EnvironmentIdOnlyPost. -type EnvironmentIdOnlyPost struct { - // Id Id of the environment to use - Id EnvironmentId `json:"id"` -} - -// EnvironmentImageSource Source of the environment's image -type EnvironmentImageSource struct { - union json.RawMessage -} - -// EnvironmentImageSourceBuild defines model for EnvironmentImageSourceBuild. -type EnvironmentImageSourceBuild string - -// EnvironmentImageSourceImage defines model for EnvironmentImageSourceImage. -type EnvironmentImageSourceImage string - -// EnvironmentKind Kind of the environment -type EnvironmentKind string - -// EnvironmentList A list of session environments -type EnvironmentList = []Environment - -// EnvironmentMountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. -type EnvironmentMountDirectory = string - -// EnvironmentMountDirectoryPatch defines model for EnvironmentMountDirectoryPatch. -type EnvironmentMountDirectoryPatch = string - -// EnvironmentPatch Update a session environment -type EnvironmentPatch struct { - // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes - Args *EnvironmentPatchArgs `json:"args,omitempty"` - - // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes - Command *EnvironmentPatchCommand `json:"command,omitempty"` - - // ContainerImage A container image - ContainerImage *ContainerImage `json:"container_image,omitempty"` - - // DefaultUrl The default path to open in a session - DefaultUrl *DefaultUrl `json:"default_url,omitempty"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - - // Gid The group ID used to run the session - Gid *EnvironmentGid `json:"gid,omitempty"` - - // IsArchived Whether this environment is archived and not for use in new projects or not - IsArchived *IsArchivedPatch `json:"is_archived,omitempty"` - MountDirectory *EnvironmentMountDirectoryPatch `json:"mount_directory,omitempty"` - - // Name Renku session name - Name *SessionName `json:"name,omitempty"` - - // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress - Port *EnvironmentPort `json:"port,omitempty"` - - // StripPathPrefix If set to true the default url and the base path where sessions are - // served will be removed from all URL paths before the requests reach - // the server running in the session. So the server in the session will - // receive HTTP requests whose base path will be "/". However this will - // not work unless the server running inside the session can be made - // aware that paths are rewritten. For example, if the application/server - // running in the session serves a HTML page that then loads javascript - // and CSS, the path where these assets should be loaded from in the browser - // will not be "/" but it has to include the prefix that was stripped. And - // the server from the session that generated the HTML page needs to know - // what is the full base path (including the part that was stripped) so that - // it can make the URLs to such assets be reachable from the browser. - StripPathPrefix *StripPathPrefixPatch `json:"strip_path_prefix,omitempty"` - - // Uid The user ID used to run the session - Uid *EnvironmentUid `json:"uid,omitempty"` - WorkingDirectory *EnvironmentWorkingDirectoryPatch `json:"working_directory,omitempty"` -} - -// EnvironmentPatchArgs The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes -type EnvironmentPatchArgs = []string - -// EnvironmentPatchCommand The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes -type EnvironmentPatchCommand = []string - -// EnvironmentPatchInLauncher defines model for EnvironmentPatchInLauncher. -type EnvironmentPatchInLauncher struct { - // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes - Args *EnvironmentPatchArgs `json:"args,omitempty"` - - // BuildParameters Data for updating a build - BuildParameters *BuildParametersPatch `json:"build_parameters,omitempty"` - - // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes - Command *EnvironmentPatchCommand `json:"command,omitempty"` - - // ContainerImage A container image - ContainerImage *ContainerImage `json:"container_image,omitempty"` - - // DefaultUrl The default path to open in a session - DefaultUrl *DefaultUrl `json:"default_url,omitempty"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - - // EnvironmentImageSource Source of the environment's image - EnvironmentImageSource *EnvironmentImageSource `json:"environment_image_source,omitempty"` - - // EnvironmentKind Kind of the environment - EnvironmentKind *EnvironmentKind `json:"environment_kind,omitempty"` - - // Gid The group ID used to run the session - Gid *EnvironmentGid `json:"gid,omitempty"` - - // IsArchived Whether this environment is archived and not for use in new projects or not - IsArchived *IsArchivedPatch `json:"is_archived,omitempty"` - MountDirectory *EnvironmentMountDirectoryPatch `json:"mount_directory,omitempty"` - - // Name Renku session name - Name *SessionName `json:"name,omitempty"` - - // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress - Port *EnvironmentPort `json:"port,omitempty"` - - // StripPathPrefix If set to true the default url and the base path where sessions are - // served will be removed from all URL paths before the requests reach - // the server running in the session. So the server in the session will - // receive HTTP requests whose base path will be "/". However this will - // not work unless the server running inside the session can be made - // aware that paths are rewritten. For example, if the application/server - // running in the session serves a HTML page that then loads javascript - // and CSS, the path where these assets should be loaded from in the browser - // will not be "/" but it has to include the prefix that was stripped. And - // the server from the session that generated the HTML page needs to know - // what is the full base path (including the part that was stripped) so that - // it can make the URLs to such assets be reachable from the browser. - StripPathPrefix *StripPathPrefixPatch `json:"strip_path_prefix,omitempty"` - - // Uid The user ID used to run the session - Uid *EnvironmentUid `json:"uid,omitempty"` - WorkingDirectory *EnvironmentWorkingDirectoryPatch `json:"working_directory,omitempty"` -} - -// EnvironmentPort The TCP port (on any container in the session) where user requests will be routed to from the ingress -type EnvironmentPort = int - -// EnvironmentPost Data required to create a session environment -type EnvironmentPost struct { - // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes - Args *EnvironmentArgs `json:"args,omitempty"` - - // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes - Command *EnvironmentCommand `json:"command,omitempty"` - - // ContainerImage A container image - ContainerImage ContainerImage `json:"container_image"` - DefaultUrl *DefaultUrl `json:"default_url,omitempty"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - EnvironmentImageSource EnvironmentImageSourceImage `json:"environment_image_source"` - Gid *EnvironmentGid `json:"gid,omitempty"` - IsArchived *IsArchived `json:"is_archived,omitempty"` - - // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. - MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` - - // Name Renku session name - Name SessionName `json:"name"` - Port *EnvironmentPort `json:"port,omitempty"` - StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` - Uid *EnvironmentUid `json:"uid,omitempty"` - - // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. - WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` -} - -// EnvironmentPostInLauncher defines model for EnvironmentPostInLauncher. -type EnvironmentPostInLauncher struct { - union json.RawMessage -} - -// EnvironmentPostInLauncherHelper defines model for EnvironmentPostInLauncherHelper. -type EnvironmentPostInLauncherHelper struct { - // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes - Args *EnvironmentArgs `json:"args,omitempty"` - - // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes - Command *EnvironmentCommand `json:"command,omitempty"` - - // ContainerImage A container image - ContainerImage ContainerImage `json:"container_image"` - DefaultUrl *DefaultUrl `json:"default_url,omitempty"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - EnvironmentImageSource EnvironmentImageSourceImage `json:"environment_image_source"` - - // EnvironmentKind Kind of the environment - EnvironmentKind EnvironmentKind `json:"environment_kind"` - Gid *EnvironmentGid `json:"gid,omitempty"` - IsArchived *IsArchived `json:"is_archived,omitempty"` - - // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. - MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` - - // Name Renku session name - Name SessionName `json:"name"` - Port *EnvironmentPort `json:"port,omitempty"` - StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` - Uid *EnvironmentUid `json:"uid,omitempty"` - - // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. - WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` -} - -// EnvironmentUid The user ID used to run the session -type EnvironmentUid = int - -// EnvironmentWithBuildGet defines model for EnvironmentWithBuildGet. -type EnvironmentWithBuildGet struct { - // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes - Args *EnvironmentArgs `json:"args,omitempty"` - - // BuildParameters Build parameters - BuildParameters BuildParameters `json:"build_parameters"` - - // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes - Command *EnvironmentCommand `json:"command,omitempty"` - - // ContainerImage A container image - ContainerImage *ContainerImage `json:"container_image,omitempty"` - - // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) - CreationDate CreationDate `json:"creation_date"` - - // DefaultUrl The default path to open in a session - DefaultUrl DefaultUrl `json:"default_url"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - EnvironmentImageSource EnvironmentImageSourceBuild `json:"environment_image_source"` - EnvironmentKind EnvironmentKind `json:"environment_kind"` - - // Gid The group ID used to run the session - Gid EnvironmentGid `json:"gid"` - - // Id ULID identifier - Id Ulid `json:"id"` - - // IsArchived Whether this environment is archived and not for use in new projects or not - IsArchived *IsArchived `json:"is_archived,omitempty"` - - // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. - MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` - - // Name Renku session name - Name SessionName `json:"name"` - - // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress - Port EnvironmentPort `json:"port"` - StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` - - // Uid The user ID used to run the session - Uid EnvironmentUid `json:"uid"` - - // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. - WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` -} - -// EnvironmentWithImageGet defines model for EnvironmentWithImageGet. -type EnvironmentWithImageGet struct { - // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes - Args *EnvironmentArgs `json:"args,omitempty"` - - // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes - Command *EnvironmentCommand `json:"command,omitempty"` - - // ContainerImage A container image - ContainerImage ContainerImage `json:"container_image"` - - // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) - CreationDate CreationDate `json:"creation_date"` - - // DefaultUrl The default path to open in a session - DefaultUrl DefaultUrl `json:"default_url"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - EnvironmentImageSource EnvironmentImageSourceImage `json:"environment_image_source"` - EnvironmentKind EnvironmentKind `json:"environment_kind"` - - // Gid The group ID used to run the session - Gid EnvironmentGid `json:"gid"` - - // Id ULID identifier - Id Ulid `json:"id"` - - // IsArchived Whether this environment is archived and not for use in new projects or not - IsArchived *IsArchived `json:"is_archived,omitempty"` - - // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. - MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` - - // Name Renku session name - Name SessionName `json:"name"` - - // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress - Port EnvironmentPort `json:"port"` - StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` - - // Uid The user ID used to run the session - Uid EnvironmentUid `json:"uid"` - - // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. - WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` -} - -// EnvironmentWithoutContainerImage A Renku 2.0 session environment -type EnvironmentWithoutContainerImage struct { - // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes - Args *EnvironmentArgs `json:"args,omitempty"` - - // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes - Command *EnvironmentCommand `json:"command,omitempty"` - - // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) - CreationDate CreationDate `json:"creation_date"` - - // DefaultUrl The default path to open in a session - DefaultUrl DefaultUrl `json:"default_url"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - - // Gid The group ID used to run the session - Gid EnvironmentGid `json:"gid"` - - // Id ULID identifier - Id Ulid `json:"id"` - - // IsArchived Whether this environment is archived and not for use in new projects or not - IsArchived *IsArchived `json:"is_archived,omitempty"` - - // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. - MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` - - // Name Renku session name - Name SessionName `json:"name"` - - // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress - Port EnvironmentPort `json:"port"` - StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` - - // Uid The user ID used to run the session - Uid EnvironmentUid `json:"uid"` - - // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. - WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` -} - -// EnvironmentWorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. -type EnvironmentWorkingDirectory = string - -// EnvironmentWorkingDirectoryPatch defines model for EnvironmentWorkingDirectoryPatch. -type EnvironmentWorkingDirectoryPatch = string - -// ErrorReason The reason why a container image build did not succeed, if available. -type ErrorReason = string - -// ErrorResponse defines model for ErrorResponse. -type ErrorResponse struct { - Error struct { - Code int `json:"code"` - Detail *string `json:"detail,omitempty"` - Message string `json:"message"` - - // TraceId Sentry trace ID for linking to corresponding log entries - TraceId *string `json:"trace_id,omitempty"` - } `json:"error"` -} - -// FrontendVariant User's Frontend Choice. -type FrontendVariant = string - -// IsArchived Whether this environment is archived and not for use in new projects or not -type IsArchived = bool - -// IsArchivedPatch Whether this environment is archived and not for use in new projects or not -type IsArchivedPatch = bool - -// Repository A git repository URL -type Repository = string - -// RepositoryRevision A git revision -type RepositoryRevision = string - -// RepositoryRevisionPatch A git revision -type RepositoryRevisionPatch = string - -// ResourceClassId The identifier of a resource class -type ResourceClassId = int - -// SessionLauncher A Renku 2.0 session definition and metadata -type SessionLauncher struct { - // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) - CreationDate CreationDate `json:"creation_date"` - - // Description A description for the resource - Description *Description `json:"description,omitempty"` - - // DiskStorage The size of disk storage for the session, in gigabytes - DiskStorage *DiskStorage `json:"disk_storage,omitempty"` - - // EnvVariables Environment variables for the session pod - EnvVariables *EnvVariables `json:"env_variables,omitempty"` - Environment EnvironmentGetInLauncher `json:"environment"` - - // Id ULID identifier - Id Ulid `json:"id"` - - // Name Renku session name - Name SessionName `json:"name"` - - // ProjectId ULID identifier - ProjectId Ulid `json:"project_id"` - - // ResourceClassId The identifier of a resource class - ResourceClassId *ResourceClassId `json:"resource_class_id"` -} - -// SessionLauncherPatch Update a session launcher -type SessionLauncherPatch struct { - // Description A description for the resource - Description *Description `json:"description,omitempty"` - DiskStorage *DiskStoragePatch `json:"disk_storage,omitempty"` - - // EnvVariables Environment variables for the session pod - EnvVariables *EnvVariables `json:"env_variables,omitempty"` - Environment *SessionLauncherPatch_Environment `json:"environment,omitempty"` - - // Name Renku session name - Name *SessionName `json:"name,omitempty"` - - // ResourceClassId The identifier of a resource class - ResourceClassId *ResourceClassId `json:"resource_class_id,omitempty"` -} - -// SessionLauncherPatch_Environment defines model for SessionLauncherPatch.Environment. -type SessionLauncherPatch_Environment struct { - union json.RawMessage -} - -// SessionLauncherPost Data required to create a session launcher -type SessionLauncherPost struct { - // Description A description for the resource - Description *Description `json:"description,omitempty"` - - // DiskStorage The size of disk storage for the session, in gigabytes - DiskStorage *DiskStorage `json:"disk_storage,omitempty"` - - // EnvVariables Environment variables for the session pod - EnvVariables *EnvVariables `json:"env_variables,omitempty"` - Environment SessionLauncherPost_Environment `json:"environment"` - - // Name Renku session name - Name SessionName `json:"name"` - - // ProjectId ULID identifier - ProjectId Ulid `json:"project_id"` - - // ResourceClassId The identifier of a resource class - ResourceClassId *ResourceClassId `json:"resource_class_id,omitempty"` -} - -// SessionLauncherPost_Environment defines model for SessionLauncherPost.Environment. -type SessionLauncherPost_Environment struct { - union json.RawMessage -} - -// SessionLaunchersList A list of Renku session launchers -type SessionLaunchersList = []SessionLauncher - -// SessionName Renku session name -type SessionName = string - -// StripPathPrefix If set to true the default url and the base path where sessions are -// served will be removed from all URL paths before the requests reach -// the server running in the session. So the server in the session will -// receive HTTP requests whose base path will be "/". However this will -// not work unless the server running inside the session can be made -// aware that paths are rewritten. For example, if the application/server -// running in the session serves a HTML page that then loads javascript -// and CSS, the path where these assets should be loaded from in the browser -// will not be "/" but it has to include the prefix that was stripped. And -// the server from the session that generated the HTML page needs to know -// what is the full base path (including the part that was stripped) so that -// it can make the URLs to such assets be reachable from the browser. -type StripPathPrefix = bool - -// StripPathPrefixPatch If set to true the default url and the base path where sessions are -// served will be removed from all URL paths before the requests reach -// the server running in the session. So the server in the session will -// receive HTTP requests whose base path will be "/". However this will -// not work unless the server running inside the session can be made -// aware that paths are rewritten. For example, if the application/server -// running in the session serves a HTML page that then loads javascript -// and CSS, the path where these assets should be loaded from in the browser -// will not be "/" but it has to include the prefix that was stripped. And -// the server from the session that generated the HTML page needs to know -// what is the full base path (including the part that was stripped) so that -// it can make the URLs to such assets be reachable from the browser. -type StripPathPrefixPatch = bool - -// Ulid ULID identifier -type Ulid = string - -// Error defines model for Error. -type Error = ErrorResponse - -// GetBuildsBuildIdLogsParams defines parameters for GetBuildsBuildIdLogs. -type GetBuildsBuildIdLogsParams struct { - // MaxLines The maximum number of most-recent lines to return for each container - MaxLines *int `form:"max_lines,omitempty" json:"max_lines,omitempty"` -} - -// GetEnvironmentsParams defines parameters for GetEnvironments. -type GetEnvironmentsParams struct { - GetEnvironmentParams *struct { - // IncludeArchived Whether to return archived environments or not - IncludeArchived *bool `json:"include_archived,omitempty"` - } `form:"get_environment_params,omitempty" json:"get_environment_params,omitempty"` -} - -// PatchBuildsBuildIdJSONRequestBody defines body for PatchBuildsBuildId for application/json ContentType. -type PatchBuildsBuildIdJSONRequestBody = BuildPatch - -// PostEnvironmentsJSONRequestBody defines body for PostEnvironments for application/json ContentType. -type PostEnvironmentsJSONRequestBody = EnvironmentPost - -// PatchEnvironmentsEnvironmentIdJSONRequestBody defines body for PatchEnvironmentsEnvironmentId for application/json ContentType. -type PatchEnvironmentsEnvironmentIdJSONRequestBody = EnvironmentPatch - -// PostSessionLaunchersJSONRequestBody defines body for PostSessionLaunchers for application/json ContentType. -type PostSessionLaunchersJSONRequestBody = SessionLauncherPost - -// PatchSessionLaunchersLauncherIdJSONRequestBody defines body for PatchSessionLaunchersLauncherId for application/json ContentType. -type PatchSessionLaunchersLauncherIdJSONRequestBody = SessionLauncherPatch - -// AsBuildNotCompletedPart returns the union data inside the Build as a BuildNotCompletedPart -func (t Build) AsBuildNotCompletedPart() (BuildNotCompletedPart, error) { - var body BuildNotCompletedPart - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromBuildNotCompletedPart overwrites any union data inside the Build as the provided BuildNotCompletedPart -func (t *Build) FromBuildNotCompletedPart(v BuildNotCompletedPart) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeBuildNotCompletedPart performs a merge with any union data inside the Build, using the provided BuildNotCompletedPart -func (t *Build) MergeBuildNotCompletedPart(v BuildNotCompletedPart) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsBuildCompletedPart returns the union data inside the Build as a BuildCompletedPart -func (t Build) AsBuildCompletedPart() (BuildCompletedPart, error) { - var body BuildCompletedPart - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromBuildCompletedPart overwrites any union data inside the Build as the provided BuildCompletedPart -func (t *Build) FromBuildCompletedPart(v BuildCompletedPart) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeBuildCompletedPart performs a merge with any union data inside the Build, using the provided BuildCompletedPart -func (t *Build) MergeBuildCompletedPart(v BuildCompletedPart) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t Build) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - if err != nil { - return nil, err - } - object := make(map[string]json.RawMessage) - if t.union != nil { - err = json.Unmarshal(b, &object) - if err != nil { - return nil, err - } - } - - object["created_at"], err = json.Marshal(t.CreatedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'created_at': %w", err) - } - - object["environment_id"], err = json.Marshal(t.EnvironmentId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'environment_id': %w", err) - } - - if t.ErrorReason != nil { - object["error_reason"], err = json.Marshal(t.ErrorReason) - if err != nil { - return nil, fmt.Errorf("error marshaling 'error_reason': %w", err) - } - } - - object["id"], err = json.Marshal(t.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - b, err = json.Marshal(object) - return b, err -} - -func (t *Build) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - if err != nil { - return err - } - object := make(map[string]json.RawMessage) - err = json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["created_at"]; found { - err = json.Unmarshal(raw, &t.CreatedAt) - if err != nil { - return fmt.Errorf("error reading 'created_at': %w", err) - } - } - - if raw, found := object["environment_id"]; found { - err = json.Unmarshal(raw, &t.EnvironmentId) - if err != nil { - return fmt.Errorf("error reading 'environment_id': %w", err) - } - } - - if raw, found := object["error_reason"]; found { - err = json.Unmarshal(raw, &t.ErrorReason) - if err != nil { - return fmt.Errorf("error reading 'error_reason': %w", err) - } - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &t.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - } - - return err -} - -// AsEnvironmentWithImageGet returns the union data inside the EnvironmentGetInLauncher as a EnvironmentWithImageGet -func (t EnvironmentGetInLauncher) AsEnvironmentWithImageGet() (EnvironmentWithImageGet, error) { - var body EnvironmentWithImageGet - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentWithImageGet overwrites any union data inside the EnvironmentGetInLauncher as the provided EnvironmentWithImageGet -func (t *EnvironmentGetInLauncher) FromEnvironmentWithImageGet(v EnvironmentWithImageGet) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentWithImageGet performs a merge with any union data inside the EnvironmentGetInLauncher, using the provided EnvironmentWithImageGet -func (t *EnvironmentGetInLauncher) MergeEnvironmentWithImageGet(v EnvironmentWithImageGet) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsEnvironmentWithBuildGet returns the union data inside the EnvironmentGetInLauncher as a EnvironmentWithBuildGet -func (t EnvironmentGetInLauncher) AsEnvironmentWithBuildGet() (EnvironmentWithBuildGet, error) { - var body EnvironmentWithBuildGet - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentWithBuildGet overwrites any union data inside the EnvironmentGetInLauncher as the provided EnvironmentWithBuildGet -func (t *EnvironmentGetInLauncher) FromEnvironmentWithBuildGet(v EnvironmentWithBuildGet) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentWithBuildGet performs a merge with any union data inside the EnvironmentGetInLauncher, using the provided EnvironmentWithBuildGet -func (t *EnvironmentGetInLauncher) MergeEnvironmentWithBuildGet(v EnvironmentWithBuildGet) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t EnvironmentGetInLauncher) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *EnvironmentGetInLauncher) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsEnvironmentImageSourceImage returns the union data inside the EnvironmentImageSource as a EnvironmentImageSourceImage -func (t EnvironmentImageSource) AsEnvironmentImageSourceImage() (EnvironmentImageSourceImage, error) { - var body EnvironmentImageSourceImage - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentImageSourceImage overwrites any union data inside the EnvironmentImageSource as the provided EnvironmentImageSourceImage -func (t *EnvironmentImageSource) FromEnvironmentImageSourceImage(v EnvironmentImageSourceImage) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentImageSourceImage performs a merge with any union data inside the EnvironmentImageSource, using the provided EnvironmentImageSourceImage -func (t *EnvironmentImageSource) MergeEnvironmentImageSourceImage(v EnvironmentImageSourceImage) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsEnvironmentImageSourceBuild returns the union data inside the EnvironmentImageSource as a EnvironmentImageSourceBuild -func (t EnvironmentImageSource) AsEnvironmentImageSourceBuild() (EnvironmentImageSourceBuild, error) { - var body EnvironmentImageSourceBuild - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentImageSourceBuild overwrites any union data inside the EnvironmentImageSource as the provided EnvironmentImageSourceBuild -func (t *EnvironmentImageSource) FromEnvironmentImageSourceBuild(v EnvironmentImageSourceBuild) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentImageSourceBuild performs a merge with any union data inside the EnvironmentImageSource, using the provided EnvironmentImageSourceBuild -func (t *EnvironmentImageSource) MergeEnvironmentImageSourceBuild(v EnvironmentImageSourceBuild) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t EnvironmentImageSource) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *EnvironmentImageSource) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsEnvironmentPostInLauncherHelper returns the union data inside the EnvironmentPostInLauncher as a EnvironmentPostInLauncherHelper -func (t EnvironmentPostInLauncher) AsEnvironmentPostInLauncherHelper() (EnvironmentPostInLauncherHelper, error) { - var body EnvironmentPostInLauncherHelper - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentPostInLauncherHelper overwrites any union data inside the EnvironmentPostInLauncher as the provided EnvironmentPostInLauncherHelper -func (t *EnvironmentPostInLauncher) FromEnvironmentPostInLauncherHelper(v EnvironmentPostInLauncherHelper) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentPostInLauncherHelper performs a merge with any union data inside the EnvironmentPostInLauncher, using the provided EnvironmentPostInLauncherHelper -func (t *EnvironmentPostInLauncher) MergeEnvironmentPostInLauncherHelper(v EnvironmentPostInLauncherHelper) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsBuildParametersPost returns the union data inside the EnvironmentPostInLauncher as a BuildParametersPost -func (t EnvironmentPostInLauncher) AsBuildParametersPost() (BuildParametersPost, error) { - var body BuildParametersPost - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromBuildParametersPost overwrites any union data inside the EnvironmentPostInLauncher as the provided BuildParametersPost -func (t *EnvironmentPostInLauncher) FromBuildParametersPost(v BuildParametersPost) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeBuildParametersPost performs a merge with any union data inside the EnvironmentPostInLauncher, using the provided BuildParametersPost -func (t *EnvironmentPostInLauncher) MergeBuildParametersPost(v BuildParametersPost) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t EnvironmentPostInLauncher) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *EnvironmentPostInLauncher) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsEnvironmentPatchInLauncher returns the union data inside the SessionLauncherPatch_Environment as a EnvironmentPatchInLauncher -func (t SessionLauncherPatch_Environment) AsEnvironmentPatchInLauncher() (EnvironmentPatchInLauncher, error) { - var body EnvironmentPatchInLauncher - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentPatchInLauncher overwrites any union data inside the SessionLauncherPatch_Environment as the provided EnvironmentPatchInLauncher -func (t *SessionLauncherPatch_Environment) FromEnvironmentPatchInLauncher(v EnvironmentPatchInLauncher) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentPatchInLauncher performs a merge with any union data inside the SessionLauncherPatch_Environment, using the provided EnvironmentPatchInLauncher -func (t *SessionLauncherPatch_Environment) MergeEnvironmentPatchInLauncher(v EnvironmentPatchInLauncher) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsEnvironmentIdOnlyPatch returns the union data inside the SessionLauncherPatch_Environment as a EnvironmentIdOnlyPatch -func (t SessionLauncherPatch_Environment) AsEnvironmentIdOnlyPatch() (EnvironmentIdOnlyPatch, error) { - var body EnvironmentIdOnlyPatch - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentIdOnlyPatch overwrites any union data inside the SessionLauncherPatch_Environment as the provided EnvironmentIdOnlyPatch -func (t *SessionLauncherPatch_Environment) FromEnvironmentIdOnlyPatch(v EnvironmentIdOnlyPatch) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentIdOnlyPatch performs a merge with any union data inside the SessionLauncherPatch_Environment, using the provided EnvironmentIdOnlyPatch -func (t *SessionLauncherPatch_Environment) MergeEnvironmentIdOnlyPatch(v EnvironmentIdOnlyPatch) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t SessionLauncherPatch_Environment) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SessionLauncherPatch_Environment) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsEnvironmentPostInLauncher returns the union data inside the SessionLauncherPost_Environment as a EnvironmentPostInLauncher -func (t SessionLauncherPost_Environment) AsEnvironmentPostInLauncher() (EnvironmentPostInLauncher, error) { - var body EnvironmentPostInLauncher - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentPostInLauncher overwrites any union data inside the SessionLauncherPost_Environment as the provided EnvironmentPostInLauncher -func (t *SessionLauncherPost_Environment) FromEnvironmentPostInLauncher(v EnvironmentPostInLauncher) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentPostInLauncher performs a merge with any union data inside the SessionLauncherPost_Environment, using the provided EnvironmentPostInLauncher -func (t *SessionLauncherPost_Environment) MergeEnvironmentPostInLauncher(v EnvironmentPostInLauncher) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsEnvironmentIdOnlyPost returns the union data inside the SessionLauncherPost_Environment as a EnvironmentIdOnlyPost -func (t SessionLauncherPost_Environment) AsEnvironmentIdOnlyPost() (EnvironmentIdOnlyPost, error) { - var body EnvironmentIdOnlyPost - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromEnvironmentIdOnlyPost overwrites any union data inside the SessionLauncherPost_Environment as the provided EnvironmentIdOnlyPost -func (t *SessionLauncherPost_Environment) FromEnvironmentIdOnlyPost(v EnvironmentIdOnlyPost) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeEnvironmentIdOnlyPost performs a merge with any union data inside the SessionLauncherPost_Environment, using the provided EnvironmentIdOnlyPost -func (t *SessionLauncherPost_Environment) MergeEnvironmentIdOnlyPost(v EnvironmentIdOnlyPost) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t SessionLauncherPost_Environment) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *SessionLauncherPost_Environment) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// 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 { - // GetBuildsBuildId request - GetBuildsBuildId(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PatchBuildsBuildIdWithBody request with any body - PatchBuildsBuildIdWithBody(ctx context.Context, buildId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PatchBuildsBuildId(ctx context.Context, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetBuildsBuildIdLogs request - GetBuildsBuildIdLogs(ctx context.Context, buildId Ulid, params *GetBuildsBuildIdLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetEnvironments request - GetEnvironments(ctx context.Context, params *GetEnvironmentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostEnvironmentsWithBody request with any body - PostEnvironmentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostEnvironments(ctx context.Context, body PostEnvironmentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteEnvironmentsEnvironmentId request - DeleteEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetEnvironmentsEnvironmentId request - GetEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PatchEnvironmentsEnvironmentIdWithBody request with any body - PatchEnvironmentsEnvironmentIdWithBody(ctx context.Context, environmentId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PatchEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetEnvironmentsEnvironmentIdBuilds request - GetEnvironmentsEnvironmentIdBuilds(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostEnvironmentsEnvironmentIdBuilds request - PostEnvironmentsEnvironmentIdBuilds(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetProjectsProjectIdSessionLaunchers request - GetProjectsProjectIdSessionLaunchers(ctx context.Context, projectId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetSessionLaunchers request - GetSessionLaunchers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostSessionLaunchersWithBody request with any body - PostSessionLaunchersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostSessionLaunchers(ctx context.Context, body PostSessionLaunchersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteSessionLaunchersLauncherId request - DeleteSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetSessionLaunchersLauncherId request - GetSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PatchSessionLaunchersLauncherIdWithBody request with any body - PatchSessionLaunchersLauncherIdWithBody(ctx context.Context, launcherId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PatchSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) GetBuildsBuildId(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetBuildsBuildIdRequest(c.Server, buildId) - 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) PatchBuildsBuildIdWithBody(ctx context.Context, buildId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchBuildsBuildIdRequestWithBody(c.Server, buildId, 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) PatchBuildsBuildId(ctx context.Context, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchBuildsBuildIdRequest(c.Server, buildId, 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) GetBuildsBuildIdLogs(ctx context.Context, buildId Ulid, params *GetBuildsBuildIdLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetBuildsBuildIdLogsRequest(c.Server, buildId, 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) GetEnvironments(ctx context.Context, params *GetEnvironmentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEnvironmentsRequest(c.Server, 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) PostEnvironmentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostEnvironmentsRequestWithBody(c.Server, 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) PostEnvironments(ctx context.Context, body PostEnvironmentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostEnvironmentsRequest(c.Server, 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) DeleteEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteEnvironmentsEnvironmentIdRequest(c.Server, environmentId) - 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) GetEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEnvironmentsEnvironmentIdRequest(c.Server, environmentId) - 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) PatchEnvironmentsEnvironmentIdWithBody(ctx context.Context, environmentId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchEnvironmentsEnvironmentIdRequestWithBody(c.Server, environmentId, 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) PatchEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchEnvironmentsEnvironmentIdRequest(c.Server, environmentId, 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) GetEnvironmentsEnvironmentIdBuilds(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEnvironmentsEnvironmentIdBuildsRequest(c.Server, environmentId) - 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) PostEnvironmentsEnvironmentIdBuilds(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostEnvironmentsEnvironmentIdBuildsRequest(c.Server, environmentId) - 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) GetProjectsProjectIdSessionLaunchers(ctx context.Context, projectId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetProjectsProjectIdSessionLaunchersRequest(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) GetSessionLaunchers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSessionLaunchersRequest(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) PostSessionLaunchersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostSessionLaunchersRequestWithBody(c.Server, 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) PostSessionLaunchers(ctx context.Context, body PostSessionLaunchersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostSessionLaunchersRequest(c.Server, 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) DeleteSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteSessionLaunchersLauncherIdRequest(c.Server, launcherId) - 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) GetSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSessionLaunchersLauncherIdRequest(c.Server, launcherId) - 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) PatchSessionLaunchersLauncherIdWithBody(ctx context.Context, launcherId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchSessionLaunchersLauncherIdRequestWithBody(c.Server, launcherId, 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) PatchSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchSessionLaunchersLauncherIdRequest(c.Server, launcherId, 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) -} - -// NewGetBuildsBuildIdRequest generates requests for GetBuildsBuildId -func NewGetBuildsBuildIdRequest(server string, buildId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "build_id", buildId, 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("/builds/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPatchBuildsBuildIdRequest calls the generic PatchBuildsBuildId builder with application/json body -func NewPatchBuildsBuildIdRequest(server string, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPatchBuildsBuildIdRequestWithBody(server, buildId, "application/json", bodyReader) -} - -// NewPatchBuildsBuildIdRequestWithBody generates requests for PatchBuildsBuildId with any type of body -func NewPatchBuildsBuildIdRequestWithBody(server string, buildId Ulid, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "build_id", buildId, 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("/builds/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetBuildsBuildIdLogsRequest generates requests for GetBuildsBuildIdLogs -func NewGetBuildsBuildIdLogsRequest(server string, buildId Ulid, params *GetBuildsBuildIdLogsParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "build_id", buildId, 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("/builds/%s/logs", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.MaxLines != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "max_lines", *params.MaxLines, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetEnvironmentsRequest generates requests for GetEnvironments -func NewGetEnvironmentsRequest(server string, params *GetEnvironmentsParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/environments") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.GetEnvironmentParams != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "get_environment_params", *params.GetEnvironmentParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPostEnvironmentsRequest calls the generic PostEnvironments builder with application/json body -func NewPostEnvironmentsRequest(server string, body PostEnvironmentsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostEnvironmentsRequestWithBody(server, "application/json", bodyReader) -} - -// NewPostEnvironmentsRequestWithBody generates requests for PostEnvironments with any type of body -func NewPostEnvironmentsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/environments") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteEnvironmentsEnvironmentIdRequest generates requests for DeleteEnvironmentsEnvironmentId -func NewDeleteEnvironmentsEnvironmentIdRequest(server string, environmentId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetEnvironmentsEnvironmentIdRequest generates requests for GetEnvironmentsEnvironmentId -func NewGetEnvironmentsEnvironmentIdRequest(server string, environmentId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPatchEnvironmentsEnvironmentIdRequest calls the generic PatchEnvironmentsEnvironmentId builder with application/json body -func NewPatchEnvironmentsEnvironmentIdRequest(server string, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPatchEnvironmentsEnvironmentIdRequestWithBody(server, environmentId, "application/json", bodyReader) -} - -// NewPatchEnvironmentsEnvironmentIdRequestWithBody generates requests for PatchEnvironmentsEnvironmentId with any type of body -func NewPatchEnvironmentsEnvironmentIdRequestWithBody(server string, environmentId Ulid, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetEnvironmentsEnvironmentIdBuildsRequest generates requests for GetEnvironmentsEnvironmentIdBuilds -func NewGetEnvironmentsEnvironmentIdBuildsRequest(server string, environmentId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s/builds", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPostEnvironmentsEnvironmentIdBuildsRequest generates requests for PostEnvironmentsEnvironmentIdBuilds -func NewPostEnvironmentsEnvironmentIdBuildsRequest(server string, environmentId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s/builds", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetProjectsProjectIdSessionLaunchersRequest generates requests for GetProjectsProjectIdSessionLaunchers -func NewGetProjectsProjectIdSessionLaunchersRequest(server string, projectId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", 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/session_launchers", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetSessionLaunchersRequest generates requests for GetSessionLaunchers -func NewGetSessionLaunchersRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/session_launchers") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPostSessionLaunchersRequest calls the generic PostSessionLaunchers builder with application/json body -func NewPostSessionLaunchersRequest(server string, body PostSessionLaunchersJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostSessionLaunchersRequestWithBody(server, "application/json", bodyReader) -} - -// NewPostSessionLaunchersRequestWithBody generates requests for PostSessionLaunchers with any type of body -func NewPostSessionLaunchersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/session_launchers") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteSessionLaunchersLauncherIdRequest generates requests for DeleteSessionLaunchersLauncherId -func NewDeleteSessionLaunchersLauncherIdRequest(server string, launcherId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "launcher_id", launcherId, 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("/session_launchers/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetSessionLaunchersLauncherIdRequest generates requests for GetSessionLaunchersLauncherId -func NewGetSessionLaunchersLauncherIdRequest(server string, launcherId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "launcher_id", launcherId, 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("/session_launchers/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPatchSessionLaunchersLauncherIdRequest calls the generic PatchSessionLaunchersLauncherId builder with application/json body -func NewPatchSessionLaunchersLauncherIdRequest(server string, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPatchSessionLaunchersLauncherIdRequestWithBody(server, launcherId, "application/json", bodyReader) -} - -// NewPatchSessionLaunchersLauncherIdRequestWithBody generates requests for PatchSessionLaunchersLauncherId with any type of body -func NewPatchSessionLaunchersLauncherIdRequestWithBody(server string, launcherId Ulid, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "launcher_id", launcherId, 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("/session_launchers/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - 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 { - // GetBuildsBuildIdWithResponse request - GetBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdResponse, error) - - // PatchBuildsBuildIdWithBodyWithResponse request with any body - PatchBuildsBuildIdWithBodyWithResponse(ctx context.Context, buildId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchBuildsBuildIdResponse, error) - - PatchBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchBuildsBuildIdResponse, error) - - // GetBuildsBuildIdLogsWithResponse request - GetBuildsBuildIdLogsWithResponse(ctx context.Context, buildId Ulid, params *GetBuildsBuildIdLogsParams, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdLogsResponse, error) - - // GetEnvironmentsWithResponse request - GetEnvironmentsWithResponse(ctx context.Context, params *GetEnvironmentsParams, reqEditors ...RequestEditorFn) (*GetEnvironmentsResponse, error) - - // PostEnvironmentsWithBodyWithResponse request with any body - PostEnvironmentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEnvironmentsResponse, error) - - PostEnvironmentsWithResponse(ctx context.Context, body PostEnvironmentsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEnvironmentsResponse, error) - - // DeleteEnvironmentsEnvironmentIdWithResponse request - DeleteEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*DeleteEnvironmentsEnvironmentIdResponse, error) - - // GetEnvironmentsEnvironmentIdWithResponse request - GetEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*GetEnvironmentsEnvironmentIdResponse, error) - - // PatchEnvironmentsEnvironmentIdWithBodyWithResponse request with any body - PatchEnvironmentsEnvironmentIdWithBodyWithResponse(ctx context.Context, environmentId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchEnvironmentsEnvironmentIdResponse, error) - - PatchEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchEnvironmentsEnvironmentIdResponse, error) - - // GetEnvironmentsEnvironmentIdBuildsWithResponse request - GetEnvironmentsEnvironmentIdBuildsWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*GetEnvironmentsEnvironmentIdBuildsResponse, error) - - // PostEnvironmentsEnvironmentIdBuildsWithResponse request - PostEnvironmentsEnvironmentIdBuildsWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*PostEnvironmentsEnvironmentIdBuildsResponse, error) - - // GetProjectsProjectIdSessionLaunchersWithResponse request - GetProjectsProjectIdSessionLaunchersWithResponse(ctx context.Context, projectId Ulid, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdSessionLaunchersResponse, error) - - // GetSessionLaunchersWithResponse request - GetSessionLaunchersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSessionLaunchersResponse, error) - - // PostSessionLaunchersWithBodyWithResponse request with any body - PostSessionLaunchersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionLaunchersResponse, error) - - PostSessionLaunchersWithResponse(ctx context.Context, body PostSessionLaunchersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionLaunchersResponse, error) - - // DeleteSessionLaunchersLauncherIdWithResponse request - DeleteSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*DeleteSessionLaunchersLauncherIdResponse, error) - - // GetSessionLaunchersLauncherIdWithResponse request - GetSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*GetSessionLaunchersLauncherIdResponse, error) - - // PatchSessionLaunchersLauncherIdWithBodyWithResponse request with any body - PatchSessionLaunchersLauncherIdWithBodyWithResponse(ctx context.Context, launcherId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchSessionLaunchersLauncherIdResponse, error) - - PatchSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchSessionLaunchersLauncherIdResponse, error) -} - -type GetBuildsBuildIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Build - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetBuildsBuildIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetBuildsBuildIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PatchBuildsBuildIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Build - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PatchBuildsBuildIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PatchBuildsBuildIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetBuildsBuildIdLogsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *BuildLogs - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetBuildsBuildIdLogsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetBuildsBuildIdLogsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetEnvironmentsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *EnvironmentList - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetEnvironmentsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetEnvironmentsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostEnvironmentsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *Environment - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PostEnvironmentsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostEnvironmentsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteEnvironmentsEnvironmentIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r DeleteEnvironmentsEnvironmentIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteEnvironmentsEnvironmentIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetEnvironmentsEnvironmentIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Environment - JSON404 *ErrorResponse - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetEnvironmentsEnvironmentIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetEnvironmentsEnvironmentIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PatchEnvironmentsEnvironmentIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Environment - JSON404 *ErrorResponse - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PatchEnvironmentsEnvironmentIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PatchEnvironmentsEnvironmentIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetEnvironmentsEnvironmentIdBuildsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *BuildList - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetEnvironmentsEnvironmentIdBuildsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetEnvironmentsEnvironmentIdBuildsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostEnvironmentsEnvironmentIdBuildsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *Build - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PostEnvironmentsEnvironmentIdBuildsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostEnvironmentsEnvironmentIdBuildsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetProjectsProjectIdSessionLaunchersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SessionLaunchersList - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetProjectsProjectIdSessionLaunchersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetProjectsProjectIdSessionLaunchersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetSessionLaunchersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SessionLaunchersList - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetSessionLaunchersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetSessionLaunchersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostSessionLaunchersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *SessionLauncher - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PostSessionLaunchersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostSessionLaunchersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteSessionLaunchersLauncherIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r DeleteSessionLaunchersLauncherIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteSessionLaunchersLauncherIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetSessionLaunchersLauncherIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SessionLauncher - JSON404 *ErrorResponse - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetSessionLaunchersLauncherIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetSessionLaunchersLauncherIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PatchSessionLaunchersLauncherIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SessionLauncher - JSON404 *ErrorResponse - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PatchSessionLaunchersLauncherIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PatchSessionLaunchersLauncherIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// GetBuildsBuildIdWithResponse request returning *GetBuildsBuildIdResponse -func (c *ClientWithResponses) GetBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdResponse, error) { - rsp, err := c.GetBuildsBuildId(ctx, buildId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetBuildsBuildIdResponse(rsp) -} - -// PatchBuildsBuildIdWithBodyWithResponse request with arbitrary body returning *PatchBuildsBuildIdResponse -func (c *ClientWithResponses) PatchBuildsBuildIdWithBodyWithResponse(ctx context.Context, buildId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchBuildsBuildIdResponse, error) { - rsp, err := c.PatchBuildsBuildIdWithBody(ctx, buildId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePatchBuildsBuildIdResponse(rsp) -} - -func (c *ClientWithResponses) PatchBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchBuildsBuildIdResponse, error) { - rsp, err := c.PatchBuildsBuildId(ctx, buildId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePatchBuildsBuildIdResponse(rsp) -} - -// GetBuildsBuildIdLogsWithResponse request returning *GetBuildsBuildIdLogsResponse -func (c *ClientWithResponses) GetBuildsBuildIdLogsWithResponse(ctx context.Context, buildId Ulid, params *GetBuildsBuildIdLogsParams, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdLogsResponse, error) { - rsp, err := c.GetBuildsBuildIdLogs(ctx, buildId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetBuildsBuildIdLogsResponse(rsp) -} - -// GetEnvironmentsWithResponse request returning *GetEnvironmentsResponse -func (c *ClientWithResponses) GetEnvironmentsWithResponse(ctx context.Context, params *GetEnvironmentsParams, reqEditors ...RequestEditorFn) (*GetEnvironmentsResponse, error) { - rsp, err := c.GetEnvironments(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEnvironmentsResponse(rsp) -} - -// PostEnvironmentsWithBodyWithResponse request with arbitrary body returning *PostEnvironmentsResponse -func (c *ClientWithResponses) PostEnvironmentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEnvironmentsResponse, error) { - rsp, err := c.PostEnvironmentsWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostEnvironmentsResponse(rsp) -} - -func (c *ClientWithResponses) PostEnvironmentsWithResponse(ctx context.Context, body PostEnvironmentsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEnvironmentsResponse, error) { - rsp, err := c.PostEnvironments(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostEnvironmentsResponse(rsp) -} - -// DeleteEnvironmentsEnvironmentIdWithResponse request returning *DeleteEnvironmentsEnvironmentIdResponse -func (c *ClientWithResponses) DeleteEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*DeleteEnvironmentsEnvironmentIdResponse, error) { - rsp, err := c.DeleteEnvironmentsEnvironmentId(ctx, environmentId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteEnvironmentsEnvironmentIdResponse(rsp) -} - -// GetEnvironmentsEnvironmentIdWithResponse request returning *GetEnvironmentsEnvironmentIdResponse -func (c *ClientWithResponses) GetEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*GetEnvironmentsEnvironmentIdResponse, error) { - rsp, err := c.GetEnvironmentsEnvironmentId(ctx, environmentId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEnvironmentsEnvironmentIdResponse(rsp) -} - -// PatchEnvironmentsEnvironmentIdWithBodyWithResponse request with arbitrary body returning *PatchEnvironmentsEnvironmentIdResponse -func (c *ClientWithResponses) PatchEnvironmentsEnvironmentIdWithBodyWithResponse(ctx context.Context, environmentId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchEnvironmentsEnvironmentIdResponse, error) { - rsp, err := c.PatchEnvironmentsEnvironmentIdWithBody(ctx, environmentId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePatchEnvironmentsEnvironmentIdResponse(rsp) -} - -func (c *ClientWithResponses) PatchEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchEnvironmentsEnvironmentIdResponse, error) { - rsp, err := c.PatchEnvironmentsEnvironmentId(ctx, environmentId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePatchEnvironmentsEnvironmentIdResponse(rsp) -} - -// GetEnvironmentsEnvironmentIdBuildsWithResponse request returning *GetEnvironmentsEnvironmentIdBuildsResponse -func (c *ClientWithResponses) GetEnvironmentsEnvironmentIdBuildsWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*GetEnvironmentsEnvironmentIdBuildsResponse, error) { - rsp, err := c.GetEnvironmentsEnvironmentIdBuilds(ctx, environmentId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEnvironmentsEnvironmentIdBuildsResponse(rsp) -} - -// PostEnvironmentsEnvironmentIdBuildsWithResponse request returning *PostEnvironmentsEnvironmentIdBuildsResponse -func (c *ClientWithResponses) PostEnvironmentsEnvironmentIdBuildsWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*PostEnvironmentsEnvironmentIdBuildsResponse, error) { - rsp, err := c.PostEnvironmentsEnvironmentIdBuilds(ctx, environmentId, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostEnvironmentsEnvironmentIdBuildsResponse(rsp) -} - -// GetProjectsProjectIdSessionLaunchersWithResponse request returning *GetProjectsProjectIdSessionLaunchersResponse -func (c *ClientWithResponses) GetProjectsProjectIdSessionLaunchersWithResponse(ctx context.Context, projectId Ulid, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdSessionLaunchersResponse, error) { - rsp, err := c.GetProjectsProjectIdSessionLaunchers(ctx, projectId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetProjectsProjectIdSessionLaunchersResponse(rsp) -} - -// GetSessionLaunchersWithResponse request returning *GetSessionLaunchersResponse -func (c *ClientWithResponses) GetSessionLaunchersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSessionLaunchersResponse, error) { - rsp, err := c.GetSessionLaunchers(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetSessionLaunchersResponse(rsp) -} - -// PostSessionLaunchersWithBodyWithResponse request with arbitrary body returning *PostSessionLaunchersResponse -func (c *ClientWithResponses) PostSessionLaunchersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionLaunchersResponse, error) { - rsp, err := c.PostSessionLaunchersWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostSessionLaunchersResponse(rsp) -} - -func (c *ClientWithResponses) PostSessionLaunchersWithResponse(ctx context.Context, body PostSessionLaunchersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionLaunchersResponse, error) { - rsp, err := c.PostSessionLaunchers(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostSessionLaunchersResponse(rsp) -} - -// DeleteSessionLaunchersLauncherIdWithResponse request returning *DeleteSessionLaunchersLauncherIdResponse -func (c *ClientWithResponses) DeleteSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*DeleteSessionLaunchersLauncherIdResponse, error) { - rsp, err := c.DeleteSessionLaunchersLauncherId(ctx, launcherId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteSessionLaunchersLauncherIdResponse(rsp) -} - -// GetSessionLaunchersLauncherIdWithResponse request returning *GetSessionLaunchersLauncherIdResponse -func (c *ClientWithResponses) GetSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*GetSessionLaunchersLauncherIdResponse, error) { - rsp, err := c.GetSessionLaunchersLauncherId(ctx, launcherId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetSessionLaunchersLauncherIdResponse(rsp) -} - -// PatchSessionLaunchersLauncherIdWithBodyWithResponse request with arbitrary body returning *PatchSessionLaunchersLauncherIdResponse -func (c *ClientWithResponses) PatchSessionLaunchersLauncherIdWithBodyWithResponse(ctx context.Context, launcherId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchSessionLaunchersLauncherIdResponse, error) { - rsp, err := c.PatchSessionLaunchersLauncherIdWithBody(ctx, launcherId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePatchSessionLaunchersLauncherIdResponse(rsp) -} - -func (c *ClientWithResponses) PatchSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchSessionLaunchersLauncherIdResponse, error) { - rsp, err := c.PatchSessionLaunchersLauncherId(ctx, launcherId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePatchSessionLaunchersLauncherIdResponse(rsp) -} - -// ParseGetBuildsBuildIdResponse parses an HTTP response from a GetBuildsBuildIdWithResponse call -func ParseGetBuildsBuildIdResponse(rsp *http.Response) (*GetBuildsBuildIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetBuildsBuildIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Build - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePatchBuildsBuildIdResponse parses an HTTP response from a PatchBuildsBuildIdWithResponse call -func ParsePatchBuildsBuildIdResponse(rsp *http.Response) (*PatchBuildsBuildIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PatchBuildsBuildIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Build - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetBuildsBuildIdLogsResponse parses an HTTP response from a GetBuildsBuildIdLogsWithResponse call -func ParseGetBuildsBuildIdLogsResponse(rsp *http.Response) (*GetBuildsBuildIdLogsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetBuildsBuildIdLogsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BuildLogs - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetEnvironmentsResponse parses an HTTP response from a GetEnvironmentsWithResponse call -func ParseGetEnvironmentsResponse(rsp *http.Response) (*GetEnvironmentsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetEnvironmentsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest EnvironmentList - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePostEnvironmentsResponse parses an HTTP response from a PostEnvironmentsWithResponse call -func ParsePostEnvironmentsResponse(rsp *http.Response) (*PostEnvironmentsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostEnvironmentsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Environment - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDeleteEnvironmentsEnvironmentIdResponse parses an HTTP response from a DeleteEnvironmentsEnvironmentIdWithResponse call -func ParseDeleteEnvironmentsEnvironmentIdResponse(rsp *http.Response) (*DeleteEnvironmentsEnvironmentIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteEnvironmentsEnvironmentIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetEnvironmentsEnvironmentIdResponse parses an HTTP response from a GetEnvironmentsEnvironmentIdWithResponse call -func ParseGetEnvironmentsEnvironmentIdResponse(rsp *http.Response) (*GetEnvironmentsEnvironmentIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetEnvironmentsEnvironmentIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Environment - 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 == 404: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePatchEnvironmentsEnvironmentIdResponse parses an HTTP response from a PatchEnvironmentsEnvironmentIdWithResponse call -func ParsePatchEnvironmentsEnvironmentIdResponse(rsp *http.Response) (*PatchEnvironmentsEnvironmentIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PatchEnvironmentsEnvironmentIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Environment - 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 == 404: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetEnvironmentsEnvironmentIdBuildsResponse parses an HTTP response from a GetEnvironmentsEnvironmentIdBuildsWithResponse call -func ParseGetEnvironmentsEnvironmentIdBuildsResponse(rsp *http.Response) (*GetEnvironmentsEnvironmentIdBuildsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetEnvironmentsEnvironmentIdBuildsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BuildList - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePostEnvironmentsEnvironmentIdBuildsResponse parses an HTTP response from a PostEnvironmentsEnvironmentIdBuildsWithResponse call -func ParsePostEnvironmentsEnvironmentIdBuildsResponse(rsp *http.Response) (*PostEnvironmentsEnvironmentIdBuildsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostEnvironmentsEnvironmentIdBuildsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Build - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetProjectsProjectIdSessionLaunchersResponse parses an HTTP response from a GetProjectsProjectIdSessionLaunchersWithResponse call -func ParseGetProjectsProjectIdSessionLaunchersResponse(rsp *http.Response) (*GetProjectsProjectIdSessionLaunchersResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetProjectsProjectIdSessionLaunchersResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SessionLaunchersList - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetSessionLaunchersResponse parses an HTTP response from a GetSessionLaunchersWithResponse call -func ParseGetSessionLaunchersResponse(rsp *http.Response) (*GetSessionLaunchersResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetSessionLaunchersResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SessionLaunchersList - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePostSessionLaunchersResponse parses an HTTP response from a PostSessionLaunchersWithResponse call -func ParsePostSessionLaunchersResponse(rsp *http.Response) (*PostSessionLaunchersResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostSessionLaunchersResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest SessionLauncher - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDeleteSessionLaunchersLauncherIdResponse parses an HTTP response from a DeleteSessionLaunchersLauncherIdWithResponse call -func ParseDeleteSessionLaunchersLauncherIdResponse(rsp *http.Response) (*DeleteSessionLaunchersLauncherIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteSessionLaunchersLauncherIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetSessionLaunchersLauncherIdResponse parses an HTTP response from a GetSessionLaunchersLauncherIdWithResponse call -func ParseGetSessionLaunchersLauncherIdResponse(rsp *http.Response) (*GetSessionLaunchersLauncherIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetSessionLaunchersLauncherIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SessionLauncher - 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 == 404: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePatchSessionLaunchersLauncherIdResponse parses an HTTP response from a PatchSessionLaunchersLauncherIdWithResponse call -func ParsePatchSessionLaunchersLauncherIdResponse(rsp *http.Response) (*PatchSessionLaunchersLauncherIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PatchSessionLaunchersLauncherIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SessionLauncher - 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 == 404: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// Base64 encoded, gzipped, json marshaled Swagger object -var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+x8a3fbNtL/V8Hhf89p0qVuju3GfvV37Fz81El8fGm7if3oQORI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EXHH2v+5GuOic", - "X4+3Mv97vSiBp7e9b5u/K2Qat5lzf6JntJEdaytlH3bXqjEfDbYKW2KSWioDrsLJJQtz14BnIWm9zlK2", - "XnBjFeg34PzG2VxVHEuO8ALoXYx22t3v15VMTub7fnI036Ti5C+T8aldW79Wbsj5fry4TWSENu+qPV+i", - "yH6VIXXKCthPmGiINkArInyFY1aZum6OvpCIFxJzWc6dE3v6PO1oUjVbTabbE3BrpNNz91EWXFdQv6Hp", - "+GFRzRzyiY8okyi5waGZhSeY6CRScdGXEqLPsfw8/AihKV9eRFFy36pyLgjp5a5yGYJfLBvp7XZ3l/h4", - "S306HyQmQZGbRyhkHJD5CXzEInPigEIQQvFCjNlUiXs6xtIc9XA2CCBEUyxs60z6FWe5ZCHIsR4GqERT", - "zugItVAUABaAJH9AeIQJRQGW+sJIZVTJsQd9m1N8CVT11w2UYzxkHAWEaojqnCE3N9V09V3ARki1J8Wa", - "Igd7B68O9rpwAL3eLt7b8/Z/Gg5ewx4M93oHgwGsvL+g5TRffFWFy26CFrdN08vF25UFXwvgPwiUtkPH", - "Y0Y8aF5EmNtX9Bx5k1o+Xvp1DHIMHMkxEYUTeyJQuo/pWjmlL7quXgAiFFGYKryotQnEuPp5zsoBYwFg", - "WqRlQcH+tgm4KBS5l92rEZFoXjiKri/ObBi13HBYOFbye+P7WIsq5JtPZBnaeKrHARbidEH4aY5nhwS4", - "qTbOiic91cupU12XeBT5zMJqd9aHIaH6MFRLOQSJfSyxY70jub6bua636BNx1xfzoselXXP1kSY+6U/y", - "hXarq+SStsXgpom3WihaauS3ruMyGvVrcPE0BVVfg6pGxzJ0rc5Yjo6FnlkxaqrSYTPYJTxv5PQ+SIVT", - "xvc3h2j+uGljOG2eSSydxzUpMMpVfun4eg0IbwSQK4GTXmCqj5vVJ0o5IOVun5bEodazrNAuY5pjDPMF", - "usyyjXntzo2x99un7rudvU+vTt4c7F7tXiSG4DmR/PwgLmbUm2M4S4X/Na1wYnMLdjjP0xrGVawqkjM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- "guQ5q1papt++qqCruvSkgAjROByY/G/IhGwpB4BK/RiVtjQcZMzN1XFlsedLUUGYGuuPGPQRWYLZEN/3", - "dWcnD9KMjTt7lrMsBdDtyl8zZQEGzPGg5vGmTMLqx8Oe1x4omBUuni0B19viBbUSlXAfBfpQ05BhQ8QI", - "ZD9fLKNHKMKjwTNmiXNUqLeoedqVgTk7YsrzYPF5ki3bJ+SD3lPNCzDbxG/5TqEFxWdJumQUsEHx2ZLN", - "QFrFILax5zAufK3BbK2ZvzCoFQj7IaEoAh4SEwg5bnlnYqIMvW3sS5Xq0TqbU28b0y98tLVaApZ/2+TJ", - "Aj5Ok8wUpqmU7WVnC4RdNiadx+KbnzODgwDMEV5RzCf6+7ygixem65jFyhOjT3WWSuLeXfDwyQLBpOE7", - "41nNCdwrDU3iwCHhQqIowB48WXgXei6E1xKcW8vmf3/y6D6z+imp7RpUfMO3my1o8xmIOb42Y+rXRFJk", - "T481MfhqhO8OeNvdcZ4jHqqBeS1M8P+bsJ+EaiICjwyJh4YEAt/48NRMQehoO9tjEvDV9cELavEmfTR5", - "y+HTCsdzwVvOmzFIFm7/ILIjwuzZ6LUiqo1bjNTvXe7M1pJh79ukQEz4uzWPslHqI019dh7nx8qzTgKA", - "/vz8d4mqnCdDJP+f+uUz51o7SeFU+7t1X6zH6UvUNDt1mnNyMyqasOsHYT2rT0VdlaOReiP5WsT5H8/f", - "INBnA2uwd5lBsnJy8/6OrS7qG0fZlTqQ5W5GysDtGUVLPVdjJek8pn/Wi7ErYE7+qOlb5yb75hH2s0XV", - "DeXk1rZa3xPzu8+tZ88aU2TKvpVgujGAlp3TfWcg2v5W8RzhcU0Ml0Pk/2gs1wuOm25qagpdumIQq28D", - "Ox0ckY6+CzK7nf1fAAAA//9oBWzgQG0AAA==", -} - -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode -func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) - if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %w", err) - } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } - var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } - - return buf.Bytes(), nil -} - -var rawSpec = decodeSpecCached() - -// a naive cached of a decoded swagger spec -func decodeSpecCached() func() ([]byte, error) { - data, err := decodeSpec() - return func() ([]byte, error) { - return data, err - } -} - -// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. -func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - res := make(map[string]func() ([]byte, error)) - if len(pathToFile) > 0 { - res[pathToFile] = rawSpec - } - - return res -} - -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { - resolvePath := PathToRawSpec("") - - loader := openapi3.NewLoader() - loader.IsExternalRefsAllowed = true - loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - pathToFile := url.String() - pathToFile = path.Clean(pathToFile) - getSpec, ok := resolvePath[pathToFile] - if !ok { - err1 := fmt.Errorf("path not found: %s", pathToFile) - return nil, err1 - } - return getSpec() - } - var specData []byte - specData, err = rawSpec() - if err != nil { - return - } - swagger, err = loader.LoadFromData(specData) - if err != nil { - return - } - return -} diff --git a/pkg/renkuapi/users/users_gen.go b/pkg/renkuapi/users/users_gen.go deleted file mode 100644 index f8d0c54..0000000 --- a/pkg/renkuapi/users/users_gen.go +++ /dev/null @@ -1,2597 +0,0 @@ -// Package users provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT. -package users - -import ( - "bytes" - "compress/gzip" - "context" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "path" - "strings" - "time" - - "github.com/getkin/kin-openapi/openapi3" - "github.com/oapi-codegen/runtime" -) - -const ( - OidcScopes = "oidc.Scopes" -) - -// Defines values for SecretKind. -const ( - General SecretKind = "general" - Storage SecretKind = "storage" -) - -// Valid indicates whether the value is a known member of the SecretKind enum. -func (e SecretKind) Valid() bool { - switch e { - case General: - return true - case Storage: - return true - default: - return false - } -} - -// AddPinnedProject defines model for AddPinnedProject. -type AddPinnedProject struct { - // ProjectSlug The slug used to identify a project - ProjectSlug ProjectSlug `json:"project_slug"` -} - -// ErrorResponse defines model for ErrorResponse. -type ErrorResponse struct { - Error struct { - Code int `json:"code"` - Detail *string `json:"detail,omitempty"` - Message string `json:"message"` - - // TraceId Sentry trace ID for linking to corresponding log entries - TraceId *string `json:"trace_id,omitempty"` - } `json:"error"` -} - -// ExpirationTimestamp The date and time the secret is not valid anymore (this is in any timezone) -type ExpirationTimestamp = time.Time - -// ModificationDate The date and time the secret was created or modified (this is always in UTC) -type ModificationDate = time.Time - -// PinnedProjects The list of projects a user has pinned on their dashboard -type PinnedProjects struct { - ProjectSlugs *[]ProjectSlugResponse `json:"project_slugs,omitempty"` -} - -// ProjectSlug The slug used to identify a project -type ProjectSlug = string - -// ProjectSlugResponse The slug used to identify a project -type ProjectSlugResponse = string - -// SecretDefaultFilename Filename to give to this secret when mounted in Renku 1.0 sessions -type SecretDefaultFilename = string - -// SecretKind Kind of secret -type SecretKind string - -// SecretName The name of a user secret -type SecretName = string - -// SecretPatch Secret metadata to be modified -type SecretPatch struct { - // DefaultFilename Filename to give to this secret when mounted in Renku 1.0 sessions - DefaultFilename *SecretDefaultFilename `json:"default_filename,omitempty"` - - // ExpirationTimestamp The date and time the secret is not valid anymore (this is in any timezone) - ExpirationTimestamp *ExpirationTimestamp `json:"expiration_timestamp,omitempty"` - - // Name The name of a user secret - Name *SecretName `json:"name,omitempty"` - - // Value Secret value that can be any text - Value *SecretValue `json:"value,omitempty"` -} - -// SecretPost Secret metadata to be created -type SecretPost struct { - // DefaultFilename Filename to give to this secret when mounted in Renku 1.0 sessions - DefaultFilename *SecretDefaultFilename `json:"default_filename,omitempty"` - - // ExpirationTimestamp The date and time the secret is not valid anymore (this is in any timezone) - ExpirationTimestamp *ExpirationTimestamp `json:"expiration_timestamp,omitempty"` - Kind *SecretKind `json:"kind,omitempty"` - - // Name The name of a user secret - Name SecretName `json:"name"` - - // Value Secret value that can be any text - Value SecretValue `json:"value"` -} - -// SecretValue Secret value that can be any text -type SecretValue = string - -// SecretWithId A Renku secret -type SecretWithId struct { - DataConnectorIds UlidList `json:"data_connector_ids"` - - // DefaultFilename Filename to give to this secret when mounted in Renku 1.0 sessions - DefaultFilename SecretDefaultFilename `json:"default_filename"` - - // ExpirationTimestamp The date and time the secret is not valid anymore (this is in any timezone) - ExpirationTimestamp *ExpirationTimestamp `json:"expiration_timestamp,omitempty"` - - // Id ULID identifier - Id Ulid `json:"id"` - - // Kind Kind of secret - Kind SecretKind `json:"kind"` - - // ModificationDate The date and time the secret was created or modified (this is always in UTC) - ModificationDate ModificationDate `json:"modification_date"` - - // Name The name of a user secret - Name SecretName `json:"name"` - SessionSecretSlotIds UlidList `json:"session_secret_slot_ids"` -} - -// SecretsList A list of secrets -type SecretsList = []SecretWithId - -// SelfUserInfo Information about the currently logged in user -type SelfUserInfo struct { - // Email User email - Email *UserEmail `json:"email,omitempty"` - - // FirstName First or last name of the user - FirstName *UserFirstLastName `json:"first_name,omitempty"` - - // Id Keycloak user ID - Id UserId `json:"id"` - - // IsAdmin Whether the user is a platform administrator or not - IsAdmin bool `json:"is_admin"` - - // LastName First or last name of the user - LastName *UserFirstLastName `json:"last_name,omitempty"` - - // Username Handle of the user - Username Username `json:"username"` -} - -// ShowProjectMigrationBanner Should display project migration banner -type ShowProjectMigrationBanner = bool - -// Ulid ULID identifier -type Ulid = string - -// UlidList defines model for UlidList. -type UlidList = []Ulid - -// UserEmail User email -type UserEmail = string - -// UserFirstLastName First or last name of the user -type UserFirstLastName = string - -// UserId Keycloak user ID -type UserId = string - -// UserPreferences The object containing user preferences -type UserPreferences struct { - // PinnedProjects The list of projects a user has pinned on their dashboard - PinnedProjects PinnedProjects `json:"pinned_projects"` - - // ShowProjectMigrationBanner Should display project migration banner - ShowProjectMigrationBanner *ShowProjectMigrationBanner `json:"show_project_migration_banner,omitempty"` - - // UserId Keycloak user ID - UserId UserId `json:"user_id"` -} - -// UserSecretKey defines model for UserSecretKey. -type UserSecretKey struct { - // SecretKey The users secret key - SecretKey *string `json:"secret_key,omitempty"` -} - -// UserWithId defines model for UserWithId. -type UserWithId struct { - // Email User email - Email *UserEmail `json:"email,omitempty"` - - // FirstName First or last name of the user - FirstName *UserFirstLastName `json:"first_name,omitempty"` - - // Id Keycloak user ID - Id UserId `json:"id"` - - // LastName First or last name of the user - LastName *UserFirstLastName `json:"last_name,omitempty"` - - // Username Handle of the user - Username Username `json:"username"` -} - -// Username Handle of the user -type Username = string - -// UsersWithId defines model for UsersWithId. -type UsersWithId = []UserWithId - -// Version defines model for Version. -type Version struct { - Version string `json:"version"` -} - -// Error defines model for Error. -type Error = ErrorResponse - -// DeleteUserPreferencesPinnedProjectsParams defines parameters for DeleteUserPreferencesPinnedProjects. -type DeleteUserPreferencesPinnedProjectsParams struct { - // DeletePinnedParams query parameters - DeletePinnedParams *struct { - ProjectSlug *string `json:"project_slug,omitempty"` - } `form:"delete_pinned_params,omitempty" json:"delete_pinned_params,omitempty"` -} - -// GetUserSecretsParams defines parameters for GetUserSecrets. -type GetUserSecretsParams struct { - UserSecretsParams *struct { - // Kind Kind of secret - Kind *SecretKind `json:"kind,omitempty"` - } `form:"user_secrets_params,omitempty" json:"user_secrets_params,omitempty"` -} - -// GetUsersParams defines parameters for GetUsers. -type GetUsersParams struct { - UserParams *struct { - // ExactEmail Return the user(s) with an exact match on the email provided - ExactEmail *string `json:"exact_email,omitempty"` - } `form:"user_params,omitempty" json:"user_params,omitempty"` -} - -// PostUserPreferencesPinnedProjectsJSONRequestBody defines body for PostUserPreferencesPinnedProjects for application/json ContentType. -type PostUserPreferencesPinnedProjectsJSONRequestBody = AddPinnedProject - -// PostUserSecretsJSONRequestBody defines body for PostUserSecrets for application/json ContentType. -type PostUserSecretsJSONRequestBody = SecretPost - -// PatchUserSecretsSecretIdJSONRequestBody defines body for PatchUserSecretsSecretId for application/json ContentType. -type PatchUserSecretsSecretIdJSONRequestBody = SecretPatch - -// 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 { - // GetError request - GetError(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetUser request - GetUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetUserPreferences request - GetUserPreferences(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteUserPreferencesDismissProjectMigrationBanner request - DeleteUserPreferencesDismissProjectMigrationBanner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostUserPreferencesDismissProjectMigrationBanner request - PostUserPreferencesDismissProjectMigrationBanner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteUserPreferencesPinnedProjects request - DeleteUserPreferencesPinnedProjects(ctx context.Context, params *DeleteUserPreferencesPinnedProjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostUserPreferencesPinnedProjectsWithBody request with any body - PostUserPreferencesPinnedProjectsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostUserPreferencesPinnedProjects(ctx context.Context, body PostUserPreferencesPinnedProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetUserSecretKey request - GetUserSecretKey(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetUserSecrets request - GetUserSecrets(ctx context.Context, params *GetUserSecretsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostUserSecretsWithBody request with any body - PostUserSecretsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostUserSecrets(ctx context.Context, body PostUserSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteUserSecretsSecretId request - DeleteUserSecretsSecretId(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetUserSecretsSecretId request - GetUserSecretsSecretId(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PatchUserSecretsSecretIdWithBody request with any body - PatchUserSecretsSecretIdWithBody(ctx context.Context, secretId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PatchUserSecretsSecretId(ctx context.Context, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetUsers request - GetUsers(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteUsersUserId request - DeleteUsersUserId(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetUsersUserId request - GetUsersUserId(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetVersion request - GetVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) GetError(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetErrorRequest(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, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUserRequest(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) GetUserPreferences(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUserPreferencesRequest(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) DeleteUserPreferencesDismissProjectMigrationBanner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteUserPreferencesDismissProjectMigrationBannerRequest(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) PostUserPreferencesDismissProjectMigrationBanner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostUserPreferencesDismissProjectMigrationBannerRequest(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) DeleteUserPreferencesPinnedProjects(ctx context.Context, params *DeleteUserPreferencesPinnedProjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteUserPreferencesPinnedProjectsRequest(c.Server, 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) PostUserPreferencesPinnedProjectsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostUserPreferencesPinnedProjectsRequestWithBody(c.Server, 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) PostUserPreferencesPinnedProjects(ctx context.Context, body PostUserPreferencesPinnedProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostUserPreferencesPinnedProjectsRequest(c.Server, 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) GetUserSecretKey(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUserSecretKeyRequest(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) GetUserSecrets(ctx context.Context, params *GetUserSecretsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUserSecretsRequest(c.Server, 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) PostUserSecretsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostUserSecretsRequestWithBody(c.Server, 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) PostUserSecrets(ctx context.Context, body PostUserSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostUserSecretsRequest(c.Server, 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) DeleteUserSecretsSecretId(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteUserSecretsSecretIdRequest(c.Server, secretId) - 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) GetUserSecretsSecretId(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUserSecretsSecretIdRequest(c.Server, secretId) - 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) PatchUserSecretsSecretIdWithBody(ctx context.Context, secretId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchUserSecretsSecretIdRequestWithBody(c.Server, secretId, 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) PatchUserSecretsSecretId(ctx context.Context, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchUserSecretsSecretIdRequest(c.Server, secretId, 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) GetUsers(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUsersRequest(c.Server, 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) DeleteUsersUserId(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteUsersUserIdRequest(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) GetUsersUserId(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetUsersUserIdRequest(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) GetVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetVersionRequest(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) -} - -// NewGetErrorRequest generates requests for GetError -func NewGetErrorRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/error") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetUserRequest generates requests for GetUser -func NewGetUserRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetUserPreferencesRequest generates requests for GetUserPreferences -func NewGetUserPreferencesRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user/preferences") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewDeleteUserPreferencesDismissProjectMigrationBannerRequest generates requests for DeleteUserPreferencesDismissProjectMigrationBanner -func NewDeleteUserPreferencesDismissProjectMigrationBannerRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user/preferences/dismiss_project_migration_banner") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPostUserPreferencesDismissProjectMigrationBannerRequest generates requests for PostUserPreferencesDismissProjectMigrationBanner -func NewPostUserPreferencesDismissProjectMigrationBannerRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user/preferences/dismiss_project_migration_banner") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewDeleteUserPreferencesPinnedProjectsRequest generates requests for DeleteUserPreferencesPinnedProjects -func NewDeleteUserPreferencesPinnedProjectsRequest(server string, params *DeleteUserPreferencesPinnedProjectsParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user/preferences/pinned_projects") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.DeletePinnedParams != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "delete_pinned_params", *params.DeletePinnedParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPostUserPreferencesPinnedProjectsRequest calls the generic PostUserPreferencesPinnedProjects builder with application/json body -func NewPostUserPreferencesPinnedProjectsRequest(server string, body PostUserPreferencesPinnedProjectsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostUserPreferencesPinnedProjectsRequestWithBody(server, "application/json", bodyReader) -} - -// NewPostUserPreferencesPinnedProjectsRequestWithBody generates requests for PostUserPreferencesPinnedProjects with any type of body -func NewPostUserPreferencesPinnedProjectsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user/preferences/pinned_projects") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetUserSecretKeyRequest generates requests for GetUserSecretKey -func NewGetUserSecretKeyRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user/secret_key") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetUserSecretsRequest generates requests for GetUserSecrets -func NewGetUserSecretsRequest(server string, params *GetUserSecretsParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user/secrets") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.UserSecretsParams != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "user_secrets_params", *params.UserSecretsParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPostUserSecretsRequest calls the generic PostUserSecrets builder with application/json body -func NewPostUserSecretsRequest(server string, body PostUserSecretsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostUserSecretsRequestWithBody(server, "application/json", bodyReader) -} - -// NewPostUserSecretsRequestWithBody generates requests for PostUserSecrets with any type of body -func NewPostUserSecretsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/user/secrets") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteUserSecretsSecretIdRequest generates requests for DeleteUserSecretsSecretId -func NewDeleteUserSecretsSecretIdRequest(server string, secretId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secret_id", secretId, 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("/user/secrets/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetUserSecretsSecretIdRequest generates requests for GetUserSecretsSecretId -func NewGetUserSecretsSecretIdRequest(server string, secretId Ulid) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secret_id", secretId, 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("/user/secrets/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPatchUserSecretsSecretIdRequest calls the generic PatchUserSecretsSecretId builder with application/json body -func NewPatchUserSecretsSecretIdRequest(server string, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPatchUserSecretsSecretIdRequestWithBody(server, secretId, "application/json", bodyReader) -} - -// NewPatchUserSecretsSecretIdRequestWithBody generates requests for PatchUserSecretsSecretId with any type of body -func NewPatchUserSecretsSecretIdRequestWithBody(server string, secretId Ulid, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secret_id", secretId, 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("/user/secrets/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetUsersRequest generates requests for GetUsers -func NewGetUsersRequest(server string, params *GetUsersParams) (*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 - } - - if params != nil { - queryValues := queryURL.Query() - - if params.UserParams != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "user_params", *params.UserParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewDeleteUsersUserIdRequest generates requests for DeleteUsersUserId -func NewDeleteUsersUserIdRequest(server string, userId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "user_id", 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("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetUsersUserIdRequest generates requests for GetUsersUserId -func NewGetUsersUserIdRequest(server string, userId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "user_id", 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("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetVersionRequest generates requests for GetVersion -func NewGetVersionRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/version") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", 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 { - // GetErrorWithResponse request - GetErrorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetErrorResponse, error) - - // GetUserWithResponse request - GetUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserResponse, error) - - // GetUserPreferencesWithResponse request - GetUserPreferencesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserPreferencesResponse, error) - - // DeleteUserPreferencesDismissProjectMigrationBannerWithResponse request - DeleteUserPreferencesDismissProjectMigrationBannerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DeleteUserPreferencesDismissProjectMigrationBannerResponse, error) - - // PostUserPreferencesDismissProjectMigrationBannerWithResponse request - PostUserPreferencesDismissProjectMigrationBannerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostUserPreferencesDismissProjectMigrationBannerResponse, error) - - // DeleteUserPreferencesPinnedProjectsWithResponse request - DeleteUserPreferencesPinnedProjectsWithResponse(ctx context.Context, params *DeleteUserPreferencesPinnedProjectsParams, reqEditors ...RequestEditorFn) (*DeleteUserPreferencesPinnedProjectsResponse, error) - - // PostUserPreferencesPinnedProjectsWithBodyWithResponse request with any body - PostUserPreferencesPinnedProjectsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserPreferencesPinnedProjectsResponse, error) - - PostUserPreferencesPinnedProjectsWithResponse(ctx context.Context, body PostUserPreferencesPinnedProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserPreferencesPinnedProjectsResponse, error) - - // GetUserSecretKeyWithResponse request - GetUserSecretKeyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserSecretKeyResponse, error) - - // GetUserSecretsWithResponse request - GetUserSecretsWithResponse(ctx context.Context, params *GetUserSecretsParams, reqEditors ...RequestEditorFn) (*GetUserSecretsResponse, error) - - // PostUserSecretsWithBodyWithResponse request with any body - PostUserSecretsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserSecretsResponse, error) - - PostUserSecretsWithResponse(ctx context.Context, body PostUserSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserSecretsResponse, error) - - // DeleteUserSecretsSecretIdWithResponse request - DeleteUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*DeleteUserSecretsSecretIdResponse, error) - - // GetUserSecretsSecretIdWithResponse request - GetUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*GetUserSecretsSecretIdResponse, error) - - // PatchUserSecretsSecretIdWithBodyWithResponse request with any body - PatchUserSecretsSecretIdWithBodyWithResponse(ctx context.Context, secretId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchUserSecretsSecretIdResponse, error) - - PatchUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchUserSecretsSecretIdResponse, error) - - // GetUsersWithResponse request - GetUsersWithResponse(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*GetUsersResponse, error) - - // DeleteUsersUserIdWithResponse request - DeleteUsersUserIdWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*DeleteUsersUserIdResponse, error) - - // GetUsersUserIdWithResponse request - GetUsersUserIdWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetUsersUserIdResponse, error) - - // GetVersionWithResponse request - GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) -} - -type GetErrorResponse struct { - Body []byte - HTTPResponse *http.Response - JSON422 *ErrorResponse -} - -// Status returns HTTPResponse.Status -func (r GetErrorResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetErrorResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SelfUserInfo - JSONDefault *Error -} - -// 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 -} - -type GetUserPreferencesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserPreferences - JSON404 *ErrorResponse - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetUserPreferencesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetUserPreferencesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteUserPreferencesDismissProjectMigrationBannerResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserPreferences - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r DeleteUserPreferencesDismissProjectMigrationBannerResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteUserPreferencesDismissProjectMigrationBannerResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostUserPreferencesDismissProjectMigrationBannerResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserPreferences - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PostUserPreferencesDismissProjectMigrationBannerResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostUserPreferencesDismissProjectMigrationBannerResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteUserPreferencesPinnedProjectsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserPreferences - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r DeleteUserPreferencesPinnedProjectsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteUserPreferencesPinnedProjectsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostUserPreferencesPinnedProjectsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserPreferences - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PostUserPreferencesPinnedProjectsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostUserPreferencesPinnedProjectsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetUserSecretKeyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserSecretKey - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetUserSecretKeyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetUserSecretKeyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetUserSecretsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SecretsList - JSON404 *ErrorResponse - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetUserSecretsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetUserSecretsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostUserSecretsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *SecretWithId - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PostUserSecretsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostUserSecretsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteUserSecretsSecretIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r DeleteUserSecretsSecretIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteUserSecretsSecretIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetUserSecretsSecretIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SecretWithId - JSON404 *ErrorResponse - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetUserSecretsSecretIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetUserSecretsSecretIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PatchUserSecretsSecretIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *SecretWithId - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r PatchUserSecretsSecretIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PatchUserSecretsSecretIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetUsersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UsersWithId - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetUsersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetUsersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteUsersUserIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r DeleteUsersUserIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteUsersUserIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetUsersUserIdResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserWithId - JSON404 *ErrorResponse - JSONDefault *Error -} - -// Status returns HTTPResponse.Status -func (r GetUsersUserIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetUsersUserIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetVersionResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Version -} - -// Status returns HTTPResponse.Status -func (r GetVersionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetVersionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// GetErrorWithResponse request returning *GetErrorResponse -func (c *ClientWithResponses) GetErrorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetErrorResponse, error) { - rsp, err := c.GetError(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetErrorResponse(rsp) -} - -// GetUserWithResponse request returning *GetUserResponse -func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserResponse, error) { - rsp, err := c.GetUser(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUserResponse(rsp) -} - -// GetUserPreferencesWithResponse request returning *GetUserPreferencesResponse -func (c *ClientWithResponses) GetUserPreferencesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserPreferencesResponse, error) { - rsp, err := c.GetUserPreferences(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUserPreferencesResponse(rsp) -} - -// DeleteUserPreferencesDismissProjectMigrationBannerWithResponse request returning *DeleteUserPreferencesDismissProjectMigrationBannerResponse -func (c *ClientWithResponses) DeleteUserPreferencesDismissProjectMigrationBannerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DeleteUserPreferencesDismissProjectMigrationBannerResponse, error) { - rsp, err := c.DeleteUserPreferencesDismissProjectMigrationBanner(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteUserPreferencesDismissProjectMigrationBannerResponse(rsp) -} - -// PostUserPreferencesDismissProjectMigrationBannerWithResponse request returning *PostUserPreferencesDismissProjectMigrationBannerResponse -func (c *ClientWithResponses) PostUserPreferencesDismissProjectMigrationBannerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostUserPreferencesDismissProjectMigrationBannerResponse, error) { - rsp, err := c.PostUserPreferencesDismissProjectMigrationBanner(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostUserPreferencesDismissProjectMigrationBannerResponse(rsp) -} - -// DeleteUserPreferencesPinnedProjectsWithResponse request returning *DeleteUserPreferencesPinnedProjectsResponse -func (c *ClientWithResponses) DeleteUserPreferencesPinnedProjectsWithResponse(ctx context.Context, params *DeleteUserPreferencesPinnedProjectsParams, reqEditors ...RequestEditorFn) (*DeleteUserPreferencesPinnedProjectsResponse, error) { - rsp, err := c.DeleteUserPreferencesPinnedProjects(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteUserPreferencesPinnedProjectsResponse(rsp) -} - -// PostUserPreferencesPinnedProjectsWithBodyWithResponse request with arbitrary body returning *PostUserPreferencesPinnedProjectsResponse -func (c *ClientWithResponses) PostUserPreferencesPinnedProjectsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserPreferencesPinnedProjectsResponse, error) { - rsp, err := c.PostUserPreferencesPinnedProjectsWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostUserPreferencesPinnedProjectsResponse(rsp) -} - -func (c *ClientWithResponses) PostUserPreferencesPinnedProjectsWithResponse(ctx context.Context, body PostUserPreferencesPinnedProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserPreferencesPinnedProjectsResponse, error) { - rsp, err := c.PostUserPreferencesPinnedProjects(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostUserPreferencesPinnedProjectsResponse(rsp) -} - -// GetUserSecretKeyWithResponse request returning *GetUserSecretKeyResponse -func (c *ClientWithResponses) GetUserSecretKeyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserSecretKeyResponse, error) { - rsp, err := c.GetUserSecretKey(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUserSecretKeyResponse(rsp) -} - -// GetUserSecretsWithResponse request returning *GetUserSecretsResponse -func (c *ClientWithResponses) GetUserSecretsWithResponse(ctx context.Context, params *GetUserSecretsParams, reqEditors ...RequestEditorFn) (*GetUserSecretsResponse, error) { - rsp, err := c.GetUserSecrets(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUserSecretsResponse(rsp) -} - -// PostUserSecretsWithBodyWithResponse request with arbitrary body returning *PostUserSecretsResponse -func (c *ClientWithResponses) PostUserSecretsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserSecretsResponse, error) { - rsp, err := c.PostUserSecretsWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostUserSecretsResponse(rsp) -} - -func (c *ClientWithResponses) PostUserSecretsWithResponse(ctx context.Context, body PostUserSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserSecretsResponse, error) { - rsp, err := c.PostUserSecrets(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostUserSecretsResponse(rsp) -} - -// DeleteUserSecretsSecretIdWithResponse request returning *DeleteUserSecretsSecretIdResponse -func (c *ClientWithResponses) DeleteUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*DeleteUserSecretsSecretIdResponse, error) { - rsp, err := c.DeleteUserSecretsSecretId(ctx, secretId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteUserSecretsSecretIdResponse(rsp) -} - -// GetUserSecretsSecretIdWithResponse request returning *GetUserSecretsSecretIdResponse -func (c *ClientWithResponses) GetUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*GetUserSecretsSecretIdResponse, error) { - rsp, err := c.GetUserSecretsSecretId(ctx, secretId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUserSecretsSecretIdResponse(rsp) -} - -// PatchUserSecretsSecretIdWithBodyWithResponse request with arbitrary body returning *PatchUserSecretsSecretIdResponse -func (c *ClientWithResponses) PatchUserSecretsSecretIdWithBodyWithResponse(ctx context.Context, secretId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchUserSecretsSecretIdResponse, error) { - rsp, err := c.PatchUserSecretsSecretIdWithBody(ctx, secretId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePatchUserSecretsSecretIdResponse(rsp) -} - -func (c *ClientWithResponses) PatchUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchUserSecretsSecretIdResponse, error) { - rsp, err := c.PatchUserSecretsSecretId(ctx, secretId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePatchUserSecretsSecretIdResponse(rsp) -} - -// GetUsersWithResponse request returning *GetUsersResponse -func (c *ClientWithResponses) GetUsersWithResponse(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*GetUsersResponse, error) { - rsp, err := c.GetUsers(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUsersResponse(rsp) -} - -// DeleteUsersUserIdWithResponse request returning *DeleteUsersUserIdResponse -func (c *ClientWithResponses) DeleteUsersUserIdWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*DeleteUsersUserIdResponse, error) { - rsp, err := c.DeleteUsersUserId(ctx, userId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteUsersUserIdResponse(rsp) -} - -// GetUsersUserIdWithResponse request returning *GetUsersUserIdResponse -func (c *ClientWithResponses) GetUsersUserIdWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetUsersUserIdResponse, error) { - rsp, err := c.GetUsersUserId(ctx, userId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetUsersUserIdResponse(rsp) -} - -// GetVersionWithResponse request returning *GetVersionResponse -func (c *ClientWithResponses) GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) { - rsp, err := c.GetVersion(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetVersionResponse(rsp) -} - -// ParseGetErrorResponse parses an HTTP response from a GetErrorWithResponse call -func ParseGetErrorResponse(rsp *http.Response) (*GetErrorResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetErrorResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &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 == 200: - var dest SelfUserInfo - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetUserPreferencesResponse parses an HTTP response from a GetUserPreferencesWithResponse call -func ParseGetUserPreferencesResponse(rsp *http.Response) (*GetUserPreferencesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetUserPreferencesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UserPreferences - 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 == 404: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDeleteUserPreferencesDismissProjectMigrationBannerResponse parses an HTTP response from a DeleteUserPreferencesDismissProjectMigrationBannerWithResponse call -func ParseDeleteUserPreferencesDismissProjectMigrationBannerResponse(rsp *http.Response) (*DeleteUserPreferencesDismissProjectMigrationBannerResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteUserPreferencesDismissProjectMigrationBannerResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UserPreferences - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePostUserPreferencesDismissProjectMigrationBannerResponse parses an HTTP response from a PostUserPreferencesDismissProjectMigrationBannerWithResponse call -func ParsePostUserPreferencesDismissProjectMigrationBannerResponse(rsp *http.Response) (*PostUserPreferencesDismissProjectMigrationBannerResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostUserPreferencesDismissProjectMigrationBannerResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UserPreferences - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDeleteUserPreferencesPinnedProjectsResponse parses an HTTP response from a DeleteUserPreferencesPinnedProjectsWithResponse call -func ParseDeleteUserPreferencesPinnedProjectsResponse(rsp *http.Response) (*DeleteUserPreferencesPinnedProjectsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteUserPreferencesPinnedProjectsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UserPreferences - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePostUserPreferencesPinnedProjectsResponse parses an HTTP response from a PostUserPreferencesPinnedProjectsWithResponse call -func ParsePostUserPreferencesPinnedProjectsResponse(rsp *http.Response) (*PostUserPreferencesPinnedProjectsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostUserPreferencesPinnedProjectsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UserPreferences - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetUserSecretKeyResponse parses an HTTP response from a GetUserSecretKeyWithResponse call -func ParseGetUserSecretKeyResponse(rsp *http.Response) (*GetUserSecretKeyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetUserSecretKeyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UserSecretKey - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetUserSecretsResponse parses an HTTP response from a GetUserSecretsWithResponse call -func ParseGetUserSecretsResponse(rsp *http.Response) (*GetUserSecretsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetUserSecretsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SecretsList - 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 == 404: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePostUserSecretsResponse parses an HTTP response from a PostUserSecretsWithResponse call -func ParsePostUserSecretsResponse(rsp *http.Response) (*PostUserSecretsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostUserSecretsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest SecretWithId - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDeleteUserSecretsSecretIdResponse parses an HTTP response from a DeleteUserSecretsSecretIdWithResponse call -func ParseDeleteUserSecretsSecretIdResponse(rsp *http.Response) (*DeleteUserSecretsSecretIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteUserSecretsSecretIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetUserSecretsSecretIdResponse parses an HTTP response from a GetUserSecretsSecretIdWithResponse call -func ParseGetUserSecretsSecretIdResponse(rsp *http.Response) (*GetUserSecretsSecretIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetUserSecretsSecretIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SecretWithId - 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 == 404: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParsePatchUserSecretsSecretIdResponse parses an HTTP response from a PatchUserSecretsSecretIdWithResponse call -func ParsePatchUserSecretsSecretIdResponse(rsp *http.Response) (*PatchUserSecretsSecretIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PatchUserSecretsSecretIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest SecretWithId - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetUsersResponse parses an HTTP response from a GetUsersWithResponse call -func ParseGetUsersResponse(rsp *http.Response) (*GetUsersResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetUsersResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UsersWithId - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseDeleteUsersUserIdResponse parses an HTTP response from a DeleteUsersUserIdWithResponse call -func ParseDeleteUsersUserIdResponse(rsp *http.Response) (*DeleteUsersUserIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteUsersUserIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetUsersUserIdResponse parses an HTTP response from a GetUsersUserIdWithResponse call -func ParseGetUsersUserIdResponse(rsp *http.Response) (*GetUsersUserIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetUsersUserIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UserWithId - 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 == 404: - var dest ErrorResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSONDefault = &dest - - } - - return response, nil -} - -// ParseGetVersionResponse parses an HTTP response from a GetVersionWithResponse call -func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetVersionResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Version - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// Base64 encoded, gzipped, json marshaled Swagger object -var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+xbe3PbNhL/KhhcZ5q0pPWwndT6586N26vbpOeJ7XQmtk8DESsJNQmwAGhb9ei73+DB", - "l0jJVO2kSeb+skURwD5++8MuFrrHkUhSwYFrhUf3WIJKBVdgP/wgpZDmn0hwDVybf0maxiwimgne+10J", - "bp6paA4JMf99JWGKR/gfvXLWnvtW9exsb/38eLlcBpiCiiRLzWR4hM/mgNzLaCokInGM9u7uEOEU7d/d", - "oVI0M9TPahY9pPSEcQ70RIrfIXJiUsrMtCQ+kSIFqZlRaUpiBQFOK4/uzSczaqzibPaQDn6FU/OqkULC", - "HxmTQPHooj7PVYD1IgU8wmJiZVoGuG4At3JFDsitXX8cCWpfhjuSpDHg0WCvvxdguIviTLEbeMM4S7IE", - "j7TMIMBJ/rFfSMC4hhlIbA2uCYtr0+FDlAgJyH0FFInUGQ4loBSZAVJzccv4DN3OiUZ6DiiVYhJDgm6J", - "wsUqSkvGZ2YRP66+yqlIQM/tNMA1upWCz1CI0hiIAqTlApEZYRzFRINsm1VLEsGYUTNtHTenwM14+wI6", - "PrLgiRm/NotpgSIhHXSoeRCLGTLvG+sGFflIdLB7sN+HAxgM9sj+fvTi5XTyHezDdH9wMJlAU6QV91s/", - "lco3AbDyvnN3K07uUiZthJ2xBJQmSdpU2gQLJRpseGiWgPWMgkiCRkwhLjS6ITGjiPCFdfAzPWfKfMW4", - "eWYH/Sk4PK/ZYdjf7YeDQdgfnA1ejnaHo+F352evvu0PRv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vY8L6aJRw0VVFqTIDdAn8fSqmpa7tnD2uGqidr/3KFMJU2pj9kgh", - "Bnc4U8fGkX2+4rMjN+GajPITwE5KbS+wDUOP8thbSMQNIG9QX6I2a9fNPgpw6g+666Y+EUr/39DO0EeP", - "snBrFLRUYFuBfqUkMxu0JAloQ7iji9Uc5Y8M5AJVXrEntrG9q+Ga4Kx4LT9aHHmBxrmoZrQZWfrsEddW", - "yl5Bt7pI6YUryIVMbLPhS49qwQH5a0W+L5+Wzn6aeG5gyOThoPT3gi6ezJyN607LesbvC4cv1p2HlCKy", - "4sKOfFE/YdiULJVnGB/YkuVC627EFecdeRm7LnXYueS2dAJOU8F4cQ0ozSYxi+KFr3bYJAZTxjxFelMR", - "p/V4xvskb140XKG6+aGFjjuwrUWCX+eRZLttY+zvJdxqS2lD5vu1KrpKf1vyTQU4kMJdvYP61zBpVLYM", - "7xVzF0ndUs+uYaGQ4PHieSs0H+L5EoofgtUrVyQ68fngiVfOD6WavvLte5VZ9phmcbwobmA81l+v7DyI", - "IA63OXXkFdJKNbSeQ3r3ntcZXXZL+7wr3Z9j2mQXSycp0fOSTYo18Kpzgq50b5tELZG/t+beWnn70alk", - "bz9SRvnXTxUvziSIlJch2uKiA0F/Kqbsf7SwKD30xbCnP80rE47JAlkntZJlfoVuhS3N408DGB+MpK3m", - "nwNLzwmfPQVL23k2s0ROyg9mdI/I5R6Xw8EdifQY2rvxb0Fnkhf7zjP13J1fE47sOJQYp/ub3K5tnzce", - "6KdYb6vNxJXfKnI5O+P+tr1ruZTX6pHKJgrsm/bHH+7HA3l///nTpWuZB8a6c27Vu/d96I47vPLtyy6s", - "U3a413POqoM7b+KWp80WXovM+n7+hBRebugpRGzKIifAZOF/gVDczbDXMlbNvXmr//g2fdqY2BwSfr/w", - "JxZf2p7+V9Bggq/SZV4HjbxD/QG9ly+xZWfSkJpXID878RznZsqb3xbEru19gV0TG18ZOJq3c5BnvgOe", - "sh4lmuDl1fJ/AQAA///7+8OCPTkAAA==", -} - -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode -func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) - if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %w", err) - } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } - var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } - - return buf.Bytes(), nil -} - -var rawSpec = decodeSpecCached() - -// a naive cached of a decoded swagger spec -func decodeSpecCached() func() ([]byte, error) { - data, err := decodeSpec() - return func() ([]byte, error) { - return data, err - } -} - -// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. -func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - res := make(map[string]func() ([]byte, error)) - if len(pathToFile) > 0 { - res[pathToFile] = rawSpec - } - - return res -} - -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { - resolvePath := PathToRawSpec("") - - loader := openapi3.NewLoader() - loader.IsExternalRefsAllowed = true - loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - pathToFile := url.String() - pathToFile = path.Clean(pathToFile) - getSpec, ok := resolvePath[pathToFile] - if !ok { - err1 := fmt.Errorf("path not found: %s", pathToFile) - return nil, err1 - } - return getSpec() - } - var specData []byte - specData, err = rawSpec() - if err != nil { - return - } - swagger, err = loader.LoadFromData(specData) - if err != nil { - return - } - return -} From 348bac50ef3a6276b471cd46190e760375d481df Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Mon, 4 May 2026 08:58:33 +0200 Subject: [PATCH 2/5] wip --- .github/workflows/test.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4383614..4062ece 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,6 +43,24 @@ jobs: - name: Build renku-dev-utils run: make rdu + test-generate: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: '1.26' + check-latest: true + + - name: Test code generation + run: | + make cleanup-generate + make generate + make rdu + lint: runs-on: ubuntu-24.04 steps: From 2d9e623fcc271dee7a2cebff7d2f4f871c3b075a Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Mon, 4 May 2026 08:59:51 +0200 Subject: [PATCH 3/5] wip --- go.mod | 5 +- go.sum | 12 +- pkg/renkuapi/session/session_gen.go | 3741 +++++++++++++++++++++++++++ pkg/renkuapi/users/users_gen.go | 2597 +++++++++++++++++++ 4 files changed, 6351 insertions(+), 4 deletions(-) create mode 100644 pkg/renkuapi/session/session_gen.go create mode 100644 pkg/renkuapi/users/users_gen.go diff --git a/go.mod b/go.mod index 1523dda..6a60ab0 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,9 @@ require ( github.com/containerd/containerd/v2 v2.2.3 github.com/distribution/distribution/v3 v3.1.0 github.com/distribution/reference v0.6.0 + github.com/getkin/kin-openapi v0.135.0 github.com/golang-jwt/jwt/v5 v5.3.1 + github.com/oapi-codegen/runtime v1.4.0 github.com/opencontainers/image-spec v1.1.1 github.com/spf13/cobra v1.10.2 github.com/spf13/viper v1.21.0 @@ -22,6 +24,7 @@ require ( ) require ( + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/typeurl/v2 v2.2.3 // indirect @@ -32,7 +35,6 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/getkin/kin-openapi v0.133.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -67,7 +69,6 @@ require ( github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/ugorji/go/codec v1.2.12 // indirect github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect github.com/woodsbury/decimal128 v1.3.0 // indirect github.com/x448/float16 v0.8.4 // indirect diff --git a/go.sum b/go.sum index f1df462..a56553d 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,7 @@ +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= +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/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -36,8 +40,8 @@ github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= 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/getkin/kin-openapi v0.133.0 h1:pJdmNohVIJ97r4AUFtEXRXwESr8b0bD721u/Tz6k8PQ= -github.com/getkin/kin-openapi v0.133.0/go.mod h1:boAciF6cXk5FhPqe/NQeBTeenbjqU4LhWBf09ILVvWE= +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-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -91,6 +95,7 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -118,6 +123,8 @@ 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/oapi-codegen/v2 v2.6.0 h1:4i+F2cvwBFZeplxCssNdLy3MhNzUD87mI3HnayHZkAU= github.com/oapi-codegen/oapi-codegen/v2 v2.6.0/go.mod h1:eWHeJSohQJIINJZzzQriVynfGsnlQVh0UkN2UYYcw4Q= +github.com/oapi-codegen/runtime v1.4.0 h1:KLOSFOp7UzkbS7Cs1ms6NBEKYr0WmH2wZG0KKbd2er4= +github.com/oapi-codegen/runtime v1.4.0/go.mod h1:5sw5fxCDmnOzKNYmkVNF8d34kyUeejJEY8HNT2WaPec= 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= @@ -171,6 +178,7 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= +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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= diff --git a/pkg/renkuapi/session/session_gen.go b/pkg/renkuapi/session/session_gen.go new file mode 100644 index 0000000..500816d --- /dev/null +++ b/pkg/renkuapi/session/session_gen.go @@ -0,0 +1,3741 @@ +// Package session provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT. +package session + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "path" + "strings" + "time" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/oapi-codegen/runtime" +) + +// Defines values for BuildCompletedPartStatus. +const ( + Succeeded BuildCompletedPartStatus = "succeeded" +) + +// Valid indicates whether the value is a known member of the BuildCompletedPartStatus enum. +func (e BuildCompletedPartStatus) Valid() bool { + switch e { + case Succeeded: + return true + default: + return false + } +} + +// Defines values for BuildNotCompletedPartStatus. +const ( + BuildNotCompletedPartStatusCancelled BuildNotCompletedPartStatus = "cancelled" + BuildNotCompletedPartStatusFailed BuildNotCompletedPartStatus = "failed" + BuildNotCompletedPartStatusInProgress BuildNotCompletedPartStatus = "in_progress" +) + +// Valid indicates whether the value is a known member of the BuildNotCompletedPartStatus enum. +func (e BuildNotCompletedPartStatus) Valid() bool { + switch e { + case BuildNotCompletedPartStatusCancelled: + return true + case BuildNotCompletedPartStatusFailed: + return true + case BuildNotCompletedPartStatusInProgress: + return true + default: + return false + } +} + +// Defines values for BuildPatchStatus. +const ( + BuildPatchStatusCancelled BuildPatchStatus = "cancelled" +) + +// Valid indicates whether the value is a known member of the BuildPatchStatus enum. +func (e BuildPatchStatus) Valid() bool { + switch e { + case BuildPatchStatusCancelled: + return true + default: + return false + } +} + +// Defines values for BuildPlatform. +const ( + Linuxamd64 BuildPlatform = "linux/amd64" + Linuxarm64 BuildPlatform = "linux/arm64" +) + +// Valid indicates whether the value is a known member of the BuildPlatform enum. +func (e BuildPlatform) Valid() bool { + switch e { + case Linuxamd64: + return true + case Linuxarm64: + return true + default: + return false + } +} + +// Defines values for EnvironmentImageSourceBuild. +const ( + EnvironmentImageSourceBuildBuild EnvironmentImageSourceBuild = "build" +) + +// Valid indicates whether the value is a known member of the EnvironmentImageSourceBuild enum. +func (e EnvironmentImageSourceBuild) Valid() bool { + switch e { + case EnvironmentImageSourceBuildBuild: + return true + default: + return false + } +} + +// Defines values for EnvironmentImageSourceImage. +const ( + Image EnvironmentImageSourceImage = "image" +) + +// Valid indicates whether the value is a known member of the EnvironmentImageSourceImage enum. +func (e EnvironmentImageSourceImage) Valid() bool { + switch e { + case Image: + return true + default: + return false + } +} + +// Defines values for EnvironmentKind. +const ( + CUSTOM EnvironmentKind = "CUSTOM" + GLOBAL EnvironmentKind = "GLOBAL" +) + +// Valid indicates whether the value is a known member of the EnvironmentKind enum. +func (e EnvironmentKind) Valid() bool { + switch e { + case CUSTOM: + return true + case GLOBAL: + return true + default: + return false + } +} + +// Build defines model for Build. +type Build struct { + // CreatedAt The date and time the resource was created (in UTC and ISO-8601 format) + CreatedAt CreationDate `json:"created_at"` + + // EnvironmentId ULID identifier + EnvironmentId Ulid `json:"environment_id"` + + // ErrorReason The reason why a container image build did not succeed, if available. + ErrorReason *ErrorReason `json:"error_reason,omitempty"` + + // Id ULID identifier + Id Ulid `json:"id"` + union json.RawMessage +} + +// BuildCommonPart defines model for BuildCommonPart. +type BuildCommonPart struct { + // CreatedAt The date and time the resource was created (in UTC and ISO-8601 format) + CreatedAt CreationDate `json:"created_at"` + + // EnvironmentId ULID identifier + EnvironmentId Ulid `json:"environment_id"` + + // ErrorReason The reason why a container image build did not succeed, if available. + ErrorReason *ErrorReason `json:"error_reason,omitempty"` + + // Id ULID identifier + Id Ulid `json:"id"` +} + +// BuildCompletedPart defines model for BuildCompletedPart. +type BuildCompletedPart struct { + // Result The result of a container image build + Result BuildResult `json:"result"` + Status BuildCompletedPartStatus `json:"status"` +} + +// BuildCompletedPartStatus defines model for BuildCompletedPart.Status. +type BuildCompletedPartStatus string + +// BuildContextDir The relative path to a folder +type BuildContextDir = string + +// BuildContextDirPatch The relative path to a folder +type BuildContextDirPatch = string + +// BuildList A list of container image builds +type BuildList = []Build + +// BuildLogs The logs of a container image build +type BuildLogs map[string]string + +// BuildNotCompletedPart defines model for BuildNotCompletedPart. +type BuildNotCompletedPart struct { + Status BuildNotCompletedPartStatus `json:"status"` +} + +// BuildNotCompletedPartStatus defines model for BuildNotCompletedPart.Status. +type BuildNotCompletedPartStatus string + +// BuildParameters Build parameters +type BuildParameters struct { + // BuilderVariant Type of virtual environment manager when building custom environments. + BuilderVariant BuilderVariant `json:"builder_variant"` + + // ContextDir The relative path to a folder + ContextDir *BuildContextDir `json:"context_dir,omitempty"` + + // FrontendVariant User's Frontend Choice. + FrontendVariant FrontendVariant `json:"frontend_variant"` + + // Platforms The target runtime platforms of a session environment. + Platforms *BuildPlatforms `json:"platforms,omitempty"` + + // Repository A git repository URL + Repository Repository `json:"repository"` + + // RepositoryRevision A git revision + RepositoryRevision *RepositoryRevision `json:"repository_revision,omitempty"` +} + +// BuildParametersPatch Data for updating a build +type BuildParametersPatch struct { + // BuilderVariant Type of virtual environment manager when building custom environments. + BuilderVariant *BuilderVariant `json:"builder_variant,omitempty"` + + // ContextDir The relative path to a folder + ContextDir *BuildContextDirPatch `json:"context_dir,omitempty"` + + // FrontendVariant User's Frontend Choice. + FrontendVariant *FrontendVariant `json:"frontend_variant,omitempty"` + + // Platforms The target runtime platforms of a session environment. + Platforms *BuildPlatforms `json:"platforms,omitempty"` + + // Repository A git repository URL + Repository *Repository `json:"repository,omitempty"` + + // RepositoryRevision A git revision + RepositoryRevision *RepositoryRevisionPatch `json:"repository_revision,omitempty"` +} + +// BuildParametersPost defines model for BuildParametersPost. +type BuildParametersPost struct { + // BuilderVariant Type of virtual environment manager when building custom environments. + BuilderVariant BuilderVariant `json:"builder_variant"` + + // ContextDir The relative path to a folder + ContextDir *BuildContextDir `json:"context_dir,omitempty"` + EnvironmentImageSource EnvironmentImageSourceBuild `json:"environment_image_source"` + + // FrontendVariant User's Frontend Choice. + FrontendVariant FrontendVariant `json:"frontend_variant"` + + // Platforms The target runtime platforms of a session environment. + Platforms *BuildPlatforms `json:"platforms,omitempty"` + + // Repository A git repository URL + Repository Repository `json:"repository"` + + // RepositoryRevision A git revision + RepositoryRevision *RepositoryRevision `json:"repository_revision,omitempty"` +} + +// BuildPatch The requested update of a container image build +type BuildPatch struct { + Status *BuildPatchStatus `json:"status,omitempty"` +} + +// BuildPatchStatus defines model for BuildPatch.Status. +type BuildPatchStatus string + +// BuildPlatform A runtime platform, e.g. "linux/amd64". +type BuildPlatform string + +// BuildPlatforms The target runtime platforms of a session environment. +type BuildPlatforms = []BuildPlatform + +// BuildResult The result of a container image build +type BuildResult struct { + // CompletedAt The date and time the resource was created (in UTC and ISO-8601 format) + CompletedAt CreationDate `json:"completed_at"` + + // Image A container image + Image ContainerImage `json:"image"` + RepositoryGitCommitSha string `json:"repository_git_commit_sha"` + RepositoryUrl string `json:"repository_url"` +} + +// BuilderVariant Type of virtual environment manager when building custom environments. +type BuilderVariant = string + +// ContainerImage A container image +type ContainerImage = string + +// CreationDate The date and time the resource was created (in UTC and ISO-8601 format) +type CreationDate = time.Time + +// DefaultUrl The default path to open in a session +type DefaultUrl = string + +// Description A description for the resource +type Description = string + +// DiskStorage The size of disk storage for the session, in gigabytes +type DiskStorage = int + +// DiskStoragePatch defines model for DiskStoragePatch. +type DiskStoragePatch = int + +// EnvVar An environment variable for the session pod +type EnvVar struct { + Name string `json:"name"` + Value *string `json:"value,omitempty"` +} + +// EnvVariables Environment variables for the session pod +type EnvVariables = []EnvVar + +// Environment defines model for Environment. +type Environment struct { + // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes + Args *EnvironmentArgs `json:"args,omitempty"` + + // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes + Command *EnvironmentCommand `json:"command,omitempty"` + + // ContainerImage A container image + ContainerImage ContainerImage `json:"container_image"` + + // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) + CreationDate CreationDate `json:"creation_date"` + + // DefaultUrl The default path to open in a session + DefaultUrl DefaultUrl `json:"default_url"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + + // Gid The group ID used to run the session + Gid EnvironmentGid `json:"gid"` + + // Id ULID identifier + Id Ulid `json:"id"` + + // IsArchived Whether this environment is archived and not for use in new projects or not + IsArchived *IsArchived `json:"is_archived,omitempty"` + + // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. + MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` + + // Name Renku session name + Name SessionName `json:"name"` + + // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress + Port EnvironmentPort `json:"port"` + StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` + + // Uid The user ID used to run the session + Uid EnvironmentUid `json:"uid"` + + // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. + WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` +} + +// EnvironmentArgs The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes +type EnvironmentArgs = []string + +// EnvironmentCommand The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes +type EnvironmentCommand = []string + +// EnvironmentGetInLauncher defines model for EnvironmentGetInLauncher. +type EnvironmentGetInLauncher struct { + union json.RawMessage +} + +// EnvironmentGid The group ID used to run the session +type EnvironmentGid = int + +// EnvironmentId Id of the environment to use +type EnvironmentId = string + +// EnvironmentIdOnlyPatch defines model for EnvironmentIdOnlyPatch. +type EnvironmentIdOnlyPatch struct { + // Id Id of the environment to use + Id *EnvironmentId `json:"id,omitempty"` +} + +// EnvironmentIdOnlyPost defines model for EnvironmentIdOnlyPost. +type EnvironmentIdOnlyPost struct { + // Id Id of the environment to use + Id EnvironmentId `json:"id"` +} + +// EnvironmentImageSource Source of the environment's image +type EnvironmentImageSource struct { + union json.RawMessage +} + +// EnvironmentImageSourceBuild defines model for EnvironmentImageSourceBuild. +type EnvironmentImageSourceBuild string + +// EnvironmentImageSourceImage defines model for EnvironmentImageSourceImage. +type EnvironmentImageSourceImage string + +// EnvironmentKind Kind of the environment +type EnvironmentKind string + +// EnvironmentList A list of session environments +type EnvironmentList = []Environment + +// EnvironmentMountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. +type EnvironmentMountDirectory = string + +// EnvironmentMountDirectoryPatch defines model for EnvironmentMountDirectoryPatch. +type EnvironmentMountDirectoryPatch = string + +// EnvironmentPatch Update a session environment +type EnvironmentPatch struct { + // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes + Args *EnvironmentPatchArgs `json:"args,omitempty"` + + // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes + Command *EnvironmentPatchCommand `json:"command,omitempty"` + + // ContainerImage A container image + ContainerImage *ContainerImage `json:"container_image,omitempty"` + + // DefaultUrl The default path to open in a session + DefaultUrl *DefaultUrl `json:"default_url,omitempty"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + + // Gid The group ID used to run the session + Gid *EnvironmentGid `json:"gid,omitempty"` + + // IsArchived Whether this environment is archived and not for use in new projects or not + IsArchived *IsArchivedPatch `json:"is_archived,omitempty"` + MountDirectory *EnvironmentMountDirectoryPatch `json:"mount_directory,omitempty"` + + // Name Renku session name + Name *SessionName `json:"name,omitempty"` + + // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress + Port *EnvironmentPort `json:"port,omitempty"` + + // StripPathPrefix If set to true the default url and the base path where sessions are + // served will be removed from all URL paths before the requests reach + // the server running in the session. So the server in the session will + // receive HTTP requests whose base path will be "/". However this will + // not work unless the server running inside the session can be made + // aware that paths are rewritten. For example, if the application/server + // running in the session serves a HTML page that then loads javascript + // and CSS, the path where these assets should be loaded from in the browser + // will not be "/" but it has to include the prefix that was stripped. And + // the server from the session that generated the HTML page needs to know + // what is the full base path (including the part that was stripped) so that + // it can make the URLs to such assets be reachable from the browser. + StripPathPrefix *StripPathPrefixPatch `json:"strip_path_prefix,omitempty"` + + // Uid The user ID used to run the session + Uid *EnvironmentUid `json:"uid,omitempty"` + WorkingDirectory *EnvironmentWorkingDirectoryPatch `json:"working_directory,omitempty"` +} + +// EnvironmentPatchArgs The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes +type EnvironmentPatchArgs = []string + +// EnvironmentPatchCommand The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes +type EnvironmentPatchCommand = []string + +// EnvironmentPatchInLauncher defines model for EnvironmentPatchInLauncher. +type EnvironmentPatchInLauncher struct { + // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes + Args *EnvironmentPatchArgs `json:"args,omitempty"` + + // BuildParameters Data for updating a build + BuildParameters *BuildParametersPatch `json:"build_parameters,omitempty"` + + // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes + Command *EnvironmentPatchCommand `json:"command,omitempty"` + + // ContainerImage A container image + ContainerImage *ContainerImage `json:"container_image,omitempty"` + + // DefaultUrl The default path to open in a session + DefaultUrl *DefaultUrl `json:"default_url,omitempty"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + + // EnvironmentImageSource Source of the environment's image + EnvironmentImageSource *EnvironmentImageSource `json:"environment_image_source,omitempty"` + + // EnvironmentKind Kind of the environment + EnvironmentKind *EnvironmentKind `json:"environment_kind,omitempty"` + + // Gid The group ID used to run the session + Gid *EnvironmentGid `json:"gid,omitempty"` + + // IsArchived Whether this environment is archived and not for use in new projects or not + IsArchived *IsArchivedPatch `json:"is_archived,omitempty"` + MountDirectory *EnvironmentMountDirectoryPatch `json:"mount_directory,omitempty"` + + // Name Renku session name + Name *SessionName `json:"name,omitempty"` + + // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress + Port *EnvironmentPort `json:"port,omitempty"` + + // StripPathPrefix If set to true the default url and the base path where sessions are + // served will be removed from all URL paths before the requests reach + // the server running in the session. So the server in the session will + // receive HTTP requests whose base path will be "/". However this will + // not work unless the server running inside the session can be made + // aware that paths are rewritten. For example, if the application/server + // running in the session serves a HTML page that then loads javascript + // and CSS, the path where these assets should be loaded from in the browser + // will not be "/" but it has to include the prefix that was stripped. And + // the server from the session that generated the HTML page needs to know + // what is the full base path (including the part that was stripped) so that + // it can make the URLs to such assets be reachable from the browser. + StripPathPrefix *StripPathPrefixPatch `json:"strip_path_prefix,omitempty"` + + // Uid The user ID used to run the session + Uid *EnvironmentUid `json:"uid,omitempty"` + WorkingDirectory *EnvironmentWorkingDirectoryPatch `json:"working_directory,omitempty"` +} + +// EnvironmentPort The TCP port (on any container in the session) where user requests will be routed to from the ingress +type EnvironmentPort = int + +// EnvironmentPost Data required to create a session environment +type EnvironmentPost struct { + // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes + Args *EnvironmentArgs `json:"args,omitempty"` + + // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes + Command *EnvironmentCommand `json:"command,omitempty"` + + // ContainerImage A container image + ContainerImage ContainerImage `json:"container_image"` + DefaultUrl *DefaultUrl `json:"default_url,omitempty"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + EnvironmentImageSource EnvironmentImageSourceImage `json:"environment_image_source"` + Gid *EnvironmentGid `json:"gid,omitempty"` + IsArchived *IsArchived `json:"is_archived,omitempty"` + + // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. + MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` + + // Name Renku session name + Name SessionName `json:"name"` + Port *EnvironmentPort `json:"port,omitempty"` + StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` + Uid *EnvironmentUid `json:"uid,omitempty"` + + // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. + WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` +} + +// EnvironmentPostInLauncher defines model for EnvironmentPostInLauncher. +type EnvironmentPostInLauncher struct { + union json.RawMessage +} + +// EnvironmentPostInLauncherHelper defines model for EnvironmentPostInLauncherHelper. +type EnvironmentPostInLauncherHelper struct { + // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes + Args *EnvironmentArgs `json:"args,omitempty"` + + // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes + Command *EnvironmentCommand `json:"command,omitempty"` + + // ContainerImage A container image + ContainerImage ContainerImage `json:"container_image"` + DefaultUrl *DefaultUrl `json:"default_url,omitempty"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + EnvironmentImageSource EnvironmentImageSourceImage `json:"environment_image_source"` + + // EnvironmentKind Kind of the environment + EnvironmentKind EnvironmentKind `json:"environment_kind"` + Gid *EnvironmentGid `json:"gid,omitempty"` + IsArchived *IsArchived `json:"is_archived,omitempty"` + + // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. + MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` + + // Name Renku session name + Name SessionName `json:"name"` + Port *EnvironmentPort `json:"port,omitempty"` + StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` + Uid *EnvironmentUid `json:"uid,omitempty"` + + // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. + WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` +} + +// EnvironmentUid The user ID used to run the session +type EnvironmentUid = int + +// EnvironmentWithBuildGet defines model for EnvironmentWithBuildGet. +type EnvironmentWithBuildGet struct { + // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes + Args *EnvironmentArgs `json:"args,omitempty"` + + // BuildParameters Build parameters + BuildParameters BuildParameters `json:"build_parameters"` + + // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes + Command *EnvironmentCommand `json:"command,omitempty"` + + // ContainerImage A container image + ContainerImage *ContainerImage `json:"container_image,omitempty"` + + // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) + CreationDate CreationDate `json:"creation_date"` + + // DefaultUrl The default path to open in a session + DefaultUrl DefaultUrl `json:"default_url"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + EnvironmentImageSource EnvironmentImageSourceBuild `json:"environment_image_source"` + EnvironmentKind EnvironmentKind `json:"environment_kind"` + + // Gid The group ID used to run the session + Gid EnvironmentGid `json:"gid"` + + // Id ULID identifier + Id Ulid `json:"id"` + + // IsArchived Whether this environment is archived and not for use in new projects or not + IsArchived *IsArchived `json:"is_archived,omitempty"` + + // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. + MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` + + // Name Renku session name + Name SessionName `json:"name"` + + // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress + Port EnvironmentPort `json:"port"` + StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` + + // Uid The user ID used to run the session + Uid EnvironmentUid `json:"uid"` + + // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. + WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` +} + +// EnvironmentWithImageGet defines model for EnvironmentWithImageGet. +type EnvironmentWithImageGet struct { + // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes + Args *EnvironmentArgs `json:"args,omitempty"` + + // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes + Command *EnvironmentCommand `json:"command,omitempty"` + + // ContainerImage A container image + ContainerImage ContainerImage `json:"container_image"` + + // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) + CreationDate CreationDate `json:"creation_date"` + + // DefaultUrl The default path to open in a session + DefaultUrl DefaultUrl `json:"default_url"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + EnvironmentImageSource EnvironmentImageSourceImage `json:"environment_image_source"` + EnvironmentKind EnvironmentKind `json:"environment_kind"` + + // Gid The group ID used to run the session + Gid EnvironmentGid `json:"gid"` + + // Id ULID identifier + Id Ulid `json:"id"` + + // IsArchived Whether this environment is archived and not for use in new projects or not + IsArchived *IsArchived `json:"is_archived,omitempty"` + + // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. + MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` + + // Name Renku session name + Name SessionName `json:"name"` + + // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress + Port EnvironmentPort `json:"port"` + StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` + + // Uid The user ID used to run the session + Uid EnvironmentUid `json:"uid"` + + // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. + WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` +} + +// EnvironmentWithoutContainerImage A Renku 2.0 session environment +type EnvironmentWithoutContainerImage struct { + // Args The arguments that will follow the command, i.e. will overwrite the image Dockerfile CMD, equivalent to args in Kubernetes + Args *EnvironmentArgs `json:"args,omitempty"` + + // Command The command that will be run i.e. will overwrite the image Dockerfile ENTRYPOINT, equivalent to command in Kubernetes + Command *EnvironmentCommand `json:"command,omitempty"` + + // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) + CreationDate CreationDate `json:"creation_date"` + + // DefaultUrl The default path to open in a session + DefaultUrl DefaultUrl `json:"default_url"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + + // Gid The group ID used to run the session + Gid EnvironmentGid `json:"gid"` + + // Id ULID identifier + Id Ulid `json:"id"` + + // IsArchived Whether this environment is archived and not for use in new projects or not + IsArchived *IsArchived `json:"is_archived,omitempty"` + + // MountDirectory The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory. + MountDirectory *EnvironmentMountDirectory `json:"mount_directory,omitempty"` + + // Name Renku session name + Name SessionName `json:"name"` + + // Port The TCP port (on any container in the session) where user requests will be routed to from the ingress + Port EnvironmentPort `json:"port"` + StripPathPrefix *StripPathPrefix `json:"strip_path_prefix,omitempty"` + + // Uid The user ID used to run the session + Uid EnvironmentUid `json:"uid"` + + // WorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. + WorkingDirectory *EnvironmentWorkingDirectory `json:"working_directory,omitempty"` +} + +// EnvironmentWorkingDirectory The location where the session will start, if left unset it will default to the session image working directory. +type EnvironmentWorkingDirectory = string + +// EnvironmentWorkingDirectoryPatch defines model for EnvironmentWorkingDirectoryPatch. +type EnvironmentWorkingDirectoryPatch = string + +// ErrorReason The reason why a container image build did not succeed, if available. +type ErrorReason = string + +// ErrorResponse defines model for ErrorResponse. +type ErrorResponse struct { + Error struct { + Code int `json:"code"` + Detail *string `json:"detail,omitempty"` + Message string `json:"message"` + + // TraceId Sentry trace ID for linking to corresponding log entries + TraceId *string `json:"trace_id,omitempty"` + } `json:"error"` +} + +// FrontendVariant User's Frontend Choice. +type FrontendVariant = string + +// IsArchived Whether this environment is archived and not for use in new projects or not +type IsArchived = bool + +// IsArchivedPatch Whether this environment is archived and not for use in new projects or not +type IsArchivedPatch = bool + +// Repository A git repository URL +type Repository = string + +// RepositoryRevision A git revision +type RepositoryRevision = string + +// RepositoryRevisionPatch A git revision +type RepositoryRevisionPatch = string + +// ResourceClassId The identifier of a resource class +type ResourceClassId = int + +// SessionLauncher A Renku 2.0 session definition and metadata +type SessionLauncher struct { + // CreationDate The date and time the resource was created (in UTC and ISO-8601 format) + CreationDate CreationDate `json:"creation_date"` + + // Description A description for the resource + Description *Description `json:"description,omitempty"` + + // DiskStorage The size of disk storage for the session, in gigabytes + DiskStorage *DiskStorage `json:"disk_storage,omitempty"` + + // EnvVariables Environment variables for the session pod + EnvVariables *EnvVariables `json:"env_variables,omitempty"` + Environment EnvironmentGetInLauncher `json:"environment"` + + // Id ULID identifier + Id Ulid `json:"id"` + + // Name Renku session name + Name SessionName `json:"name"` + + // ProjectId ULID identifier + ProjectId Ulid `json:"project_id"` + + // ResourceClassId The identifier of a resource class + ResourceClassId *ResourceClassId `json:"resource_class_id"` +} + +// SessionLauncherPatch Update a session launcher +type SessionLauncherPatch struct { + // Description A description for the resource + Description *Description `json:"description,omitempty"` + DiskStorage *DiskStoragePatch `json:"disk_storage,omitempty"` + + // EnvVariables Environment variables for the session pod + EnvVariables *EnvVariables `json:"env_variables,omitempty"` + Environment *SessionLauncherPatch_Environment `json:"environment,omitempty"` + + // Name Renku session name + Name *SessionName `json:"name,omitempty"` + + // ResourceClassId The identifier of a resource class + ResourceClassId *ResourceClassId `json:"resource_class_id,omitempty"` +} + +// SessionLauncherPatch_Environment defines model for SessionLauncherPatch.Environment. +type SessionLauncherPatch_Environment struct { + union json.RawMessage +} + +// SessionLauncherPost Data required to create a session launcher +type SessionLauncherPost struct { + // Description A description for the resource + Description *Description `json:"description,omitempty"` + + // DiskStorage The size of disk storage for the session, in gigabytes + DiskStorage *DiskStorage `json:"disk_storage,omitempty"` + + // EnvVariables Environment variables for the session pod + EnvVariables *EnvVariables `json:"env_variables,omitempty"` + Environment SessionLauncherPost_Environment `json:"environment"` + + // Name Renku session name + Name SessionName `json:"name"` + + // ProjectId ULID identifier + ProjectId Ulid `json:"project_id"` + + // ResourceClassId The identifier of a resource class + ResourceClassId *ResourceClassId `json:"resource_class_id,omitempty"` +} + +// SessionLauncherPost_Environment defines model for SessionLauncherPost.Environment. +type SessionLauncherPost_Environment struct { + union json.RawMessage +} + +// SessionLaunchersList A list of Renku session launchers +type SessionLaunchersList = []SessionLauncher + +// SessionName Renku session name +type SessionName = string + +// StripPathPrefix If set to true the default url and the base path where sessions are +// served will be removed from all URL paths before the requests reach +// the server running in the session. So the server in the session will +// receive HTTP requests whose base path will be "/". However this will +// not work unless the server running inside the session can be made +// aware that paths are rewritten. For example, if the application/server +// running in the session serves a HTML page that then loads javascript +// and CSS, the path where these assets should be loaded from in the browser +// will not be "/" but it has to include the prefix that was stripped. And +// the server from the session that generated the HTML page needs to know +// what is the full base path (including the part that was stripped) so that +// it can make the URLs to such assets be reachable from the browser. +type StripPathPrefix = bool + +// StripPathPrefixPatch If set to true the default url and the base path where sessions are +// served will be removed from all URL paths before the requests reach +// the server running in the session. So the server in the session will +// receive HTTP requests whose base path will be "/". However this will +// not work unless the server running inside the session can be made +// aware that paths are rewritten. For example, if the application/server +// running in the session serves a HTML page that then loads javascript +// and CSS, the path where these assets should be loaded from in the browser +// will not be "/" but it has to include the prefix that was stripped. And +// the server from the session that generated the HTML page needs to know +// what is the full base path (including the part that was stripped) so that +// it can make the URLs to such assets be reachable from the browser. +type StripPathPrefixPatch = bool + +// Ulid ULID identifier +type Ulid = string + +// Error defines model for Error. +type Error = ErrorResponse + +// GetBuildsBuildIdLogsParams defines parameters for GetBuildsBuildIdLogs. +type GetBuildsBuildIdLogsParams struct { + // MaxLines The maximum number of most-recent lines to return for each container + MaxLines *int `form:"max_lines,omitempty" json:"max_lines,omitempty"` +} + +// GetEnvironmentsParams defines parameters for GetEnvironments. +type GetEnvironmentsParams struct { + GetEnvironmentParams *struct { + // IncludeArchived Whether to return archived environments or not + IncludeArchived *bool `json:"include_archived,omitempty"` + } `form:"get_environment_params,omitempty" json:"get_environment_params,omitempty"` +} + +// PatchBuildsBuildIdJSONRequestBody defines body for PatchBuildsBuildId for application/json ContentType. +type PatchBuildsBuildIdJSONRequestBody = BuildPatch + +// PostEnvironmentsJSONRequestBody defines body for PostEnvironments for application/json ContentType. +type PostEnvironmentsJSONRequestBody = EnvironmentPost + +// PatchEnvironmentsEnvironmentIdJSONRequestBody defines body for PatchEnvironmentsEnvironmentId for application/json ContentType. +type PatchEnvironmentsEnvironmentIdJSONRequestBody = EnvironmentPatch + +// PostSessionLaunchersJSONRequestBody defines body for PostSessionLaunchers for application/json ContentType. +type PostSessionLaunchersJSONRequestBody = SessionLauncherPost + +// PatchSessionLaunchersLauncherIdJSONRequestBody defines body for PatchSessionLaunchersLauncherId for application/json ContentType. +type PatchSessionLaunchersLauncherIdJSONRequestBody = SessionLauncherPatch + +// AsBuildNotCompletedPart returns the union data inside the Build as a BuildNotCompletedPart +func (t Build) AsBuildNotCompletedPart() (BuildNotCompletedPart, error) { + var body BuildNotCompletedPart + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromBuildNotCompletedPart overwrites any union data inside the Build as the provided BuildNotCompletedPart +func (t *Build) FromBuildNotCompletedPart(v BuildNotCompletedPart) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeBuildNotCompletedPart performs a merge with any union data inside the Build, using the provided BuildNotCompletedPart +func (t *Build) MergeBuildNotCompletedPart(v BuildNotCompletedPart) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsBuildCompletedPart returns the union data inside the Build as a BuildCompletedPart +func (t Build) AsBuildCompletedPart() (BuildCompletedPart, error) { + var body BuildCompletedPart + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromBuildCompletedPart overwrites any union data inside the Build as the provided BuildCompletedPart +func (t *Build) FromBuildCompletedPart(v BuildCompletedPart) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeBuildCompletedPart performs a merge with any union data inside the Build, using the provided BuildCompletedPart +func (t *Build) MergeBuildCompletedPart(v BuildCompletedPart) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t Build) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + if err != nil { + return nil, err + } + object := make(map[string]json.RawMessage) + if t.union != nil { + err = json.Unmarshal(b, &object) + if err != nil { + return nil, err + } + } + + object["created_at"], err = json.Marshal(t.CreatedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'created_at': %w", err) + } + + object["environment_id"], err = json.Marshal(t.EnvironmentId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'environment_id': %w", err) + } + + if t.ErrorReason != nil { + object["error_reason"], err = json.Marshal(t.ErrorReason) + if err != nil { + return nil, fmt.Errorf("error marshaling 'error_reason': %w", err) + } + } + + object["id"], err = json.Marshal(t.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + b, err = json.Marshal(object) + return b, err +} + +func (t *Build) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + if err != nil { + return err + } + object := make(map[string]json.RawMessage) + err = json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["created_at"]; found { + err = json.Unmarshal(raw, &t.CreatedAt) + if err != nil { + return fmt.Errorf("error reading 'created_at': %w", err) + } + } + + if raw, found := object["environment_id"]; found { + err = json.Unmarshal(raw, &t.EnvironmentId) + if err != nil { + return fmt.Errorf("error reading 'environment_id': %w", err) + } + } + + if raw, found := object["error_reason"]; found { + err = json.Unmarshal(raw, &t.ErrorReason) + if err != nil { + return fmt.Errorf("error reading 'error_reason': %w", err) + } + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &t.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + } + + return err +} + +// AsEnvironmentWithImageGet returns the union data inside the EnvironmentGetInLauncher as a EnvironmentWithImageGet +func (t EnvironmentGetInLauncher) AsEnvironmentWithImageGet() (EnvironmentWithImageGet, error) { + var body EnvironmentWithImageGet + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentWithImageGet overwrites any union data inside the EnvironmentGetInLauncher as the provided EnvironmentWithImageGet +func (t *EnvironmentGetInLauncher) FromEnvironmentWithImageGet(v EnvironmentWithImageGet) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentWithImageGet performs a merge with any union data inside the EnvironmentGetInLauncher, using the provided EnvironmentWithImageGet +func (t *EnvironmentGetInLauncher) MergeEnvironmentWithImageGet(v EnvironmentWithImageGet) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsEnvironmentWithBuildGet returns the union data inside the EnvironmentGetInLauncher as a EnvironmentWithBuildGet +func (t EnvironmentGetInLauncher) AsEnvironmentWithBuildGet() (EnvironmentWithBuildGet, error) { + var body EnvironmentWithBuildGet + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentWithBuildGet overwrites any union data inside the EnvironmentGetInLauncher as the provided EnvironmentWithBuildGet +func (t *EnvironmentGetInLauncher) FromEnvironmentWithBuildGet(v EnvironmentWithBuildGet) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentWithBuildGet performs a merge with any union data inside the EnvironmentGetInLauncher, using the provided EnvironmentWithBuildGet +func (t *EnvironmentGetInLauncher) MergeEnvironmentWithBuildGet(v EnvironmentWithBuildGet) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t EnvironmentGetInLauncher) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *EnvironmentGetInLauncher) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEnvironmentImageSourceImage returns the union data inside the EnvironmentImageSource as a EnvironmentImageSourceImage +func (t EnvironmentImageSource) AsEnvironmentImageSourceImage() (EnvironmentImageSourceImage, error) { + var body EnvironmentImageSourceImage + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentImageSourceImage overwrites any union data inside the EnvironmentImageSource as the provided EnvironmentImageSourceImage +func (t *EnvironmentImageSource) FromEnvironmentImageSourceImage(v EnvironmentImageSourceImage) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentImageSourceImage performs a merge with any union data inside the EnvironmentImageSource, using the provided EnvironmentImageSourceImage +func (t *EnvironmentImageSource) MergeEnvironmentImageSourceImage(v EnvironmentImageSourceImage) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsEnvironmentImageSourceBuild returns the union data inside the EnvironmentImageSource as a EnvironmentImageSourceBuild +func (t EnvironmentImageSource) AsEnvironmentImageSourceBuild() (EnvironmentImageSourceBuild, error) { + var body EnvironmentImageSourceBuild + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentImageSourceBuild overwrites any union data inside the EnvironmentImageSource as the provided EnvironmentImageSourceBuild +func (t *EnvironmentImageSource) FromEnvironmentImageSourceBuild(v EnvironmentImageSourceBuild) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentImageSourceBuild performs a merge with any union data inside the EnvironmentImageSource, using the provided EnvironmentImageSourceBuild +func (t *EnvironmentImageSource) MergeEnvironmentImageSourceBuild(v EnvironmentImageSourceBuild) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t EnvironmentImageSource) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *EnvironmentImageSource) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEnvironmentPostInLauncherHelper returns the union data inside the EnvironmentPostInLauncher as a EnvironmentPostInLauncherHelper +func (t EnvironmentPostInLauncher) AsEnvironmentPostInLauncherHelper() (EnvironmentPostInLauncherHelper, error) { + var body EnvironmentPostInLauncherHelper + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentPostInLauncherHelper overwrites any union data inside the EnvironmentPostInLauncher as the provided EnvironmentPostInLauncherHelper +func (t *EnvironmentPostInLauncher) FromEnvironmentPostInLauncherHelper(v EnvironmentPostInLauncherHelper) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentPostInLauncherHelper performs a merge with any union data inside the EnvironmentPostInLauncher, using the provided EnvironmentPostInLauncherHelper +func (t *EnvironmentPostInLauncher) MergeEnvironmentPostInLauncherHelper(v EnvironmentPostInLauncherHelper) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsBuildParametersPost returns the union data inside the EnvironmentPostInLauncher as a BuildParametersPost +func (t EnvironmentPostInLauncher) AsBuildParametersPost() (BuildParametersPost, error) { + var body BuildParametersPost + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromBuildParametersPost overwrites any union data inside the EnvironmentPostInLauncher as the provided BuildParametersPost +func (t *EnvironmentPostInLauncher) FromBuildParametersPost(v BuildParametersPost) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeBuildParametersPost performs a merge with any union data inside the EnvironmentPostInLauncher, using the provided BuildParametersPost +func (t *EnvironmentPostInLauncher) MergeBuildParametersPost(v BuildParametersPost) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t EnvironmentPostInLauncher) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *EnvironmentPostInLauncher) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEnvironmentPatchInLauncher returns the union data inside the SessionLauncherPatch_Environment as a EnvironmentPatchInLauncher +func (t SessionLauncherPatch_Environment) AsEnvironmentPatchInLauncher() (EnvironmentPatchInLauncher, error) { + var body EnvironmentPatchInLauncher + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentPatchInLauncher overwrites any union data inside the SessionLauncherPatch_Environment as the provided EnvironmentPatchInLauncher +func (t *SessionLauncherPatch_Environment) FromEnvironmentPatchInLauncher(v EnvironmentPatchInLauncher) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentPatchInLauncher performs a merge with any union data inside the SessionLauncherPatch_Environment, using the provided EnvironmentPatchInLauncher +func (t *SessionLauncherPatch_Environment) MergeEnvironmentPatchInLauncher(v EnvironmentPatchInLauncher) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsEnvironmentIdOnlyPatch returns the union data inside the SessionLauncherPatch_Environment as a EnvironmentIdOnlyPatch +func (t SessionLauncherPatch_Environment) AsEnvironmentIdOnlyPatch() (EnvironmentIdOnlyPatch, error) { + var body EnvironmentIdOnlyPatch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentIdOnlyPatch overwrites any union data inside the SessionLauncherPatch_Environment as the provided EnvironmentIdOnlyPatch +func (t *SessionLauncherPatch_Environment) FromEnvironmentIdOnlyPatch(v EnvironmentIdOnlyPatch) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentIdOnlyPatch performs a merge with any union data inside the SessionLauncherPatch_Environment, using the provided EnvironmentIdOnlyPatch +func (t *SessionLauncherPatch_Environment) MergeEnvironmentIdOnlyPatch(v EnvironmentIdOnlyPatch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t SessionLauncherPatch_Environment) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SessionLauncherPatch_Environment) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsEnvironmentPostInLauncher returns the union data inside the SessionLauncherPost_Environment as a EnvironmentPostInLauncher +func (t SessionLauncherPost_Environment) AsEnvironmentPostInLauncher() (EnvironmentPostInLauncher, error) { + var body EnvironmentPostInLauncher + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentPostInLauncher overwrites any union data inside the SessionLauncherPost_Environment as the provided EnvironmentPostInLauncher +func (t *SessionLauncherPost_Environment) FromEnvironmentPostInLauncher(v EnvironmentPostInLauncher) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentPostInLauncher performs a merge with any union data inside the SessionLauncherPost_Environment, using the provided EnvironmentPostInLauncher +func (t *SessionLauncherPost_Environment) MergeEnvironmentPostInLauncher(v EnvironmentPostInLauncher) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsEnvironmentIdOnlyPost returns the union data inside the SessionLauncherPost_Environment as a EnvironmentIdOnlyPost +func (t SessionLauncherPost_Environment) AsEnvironmentIdOnlyPost() (EnvironmentIdOnlyPost, error) { + var body EnvironmentIdOnlyPost + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromEnvironmentIdOnlyPost overwrites any union data inside the SessionLauncherPost_Environment as the provided EnvironmentIdOnlyPost +func (t *SessionLauncherPost_Environment) FromEnvironmentIdOnlyPost(v EnvironmentIdOnlyPost) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeEnvironmentIdOnlyPost performs a merge with any union data inside the SessionLauncherPost_Environment, using the provided EnvironmentIdOnlyPost +func (t *SessionLauncherPost_Environment) MergeEnvironmentIdOnlyPost(v EnvironmentIdOnlyPost) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t SessionLauncherPost_Environment) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *SessionLauncherPost_Environment) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// 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 { + // GetBuildsBuildId request + GetBuildsBuildId(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchBuildsBuildIdWithBody request with any body + PatchBuildsBuildIdWithBody(ctx context.Context, buildId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PatchBuildsBuildId(ctx context.Context, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetBuildsBuildIdLogs request + GetBuildsBuildIdLogs(ctx context.Context, buildId Ulid, params *GetBuildsBuildIdLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEnvironments request + GetEnvironments(ctx context.Context, params *GetEnvironmentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostEnvironmentsWithBody request with any body + PostEnvironmentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostEnvironments(ctx context.Context, body PostEnvironmentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteEnvironmentsEnvironmentId request + DeleteEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEnvironmentsEnvironmentId request + GetEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchEnvironmentsEnvironmentIdWithBody request with any body + PatchEnvironmentsEnvironmentIdWithBody(ctx context.Context, environmentId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PatchEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEnvironmentsEnvironmentIdBuilds request + GetEnvironmentsEnvironmentIdBuilds(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostEnvironmentsEnvironmentIdBuilds request + PostEnvironmentsEnvironmentIdBuilds(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetProjectsProjectIdSessionLaunchers request + GetProjectsProjectIdSessionLaunchers(ctx context.Context, projectId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSessionLaunchers request + GetSessionLaunchers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostSessionLaunchersWithBody request with any body + PostSessionLaunchersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostSessionLaunchers(ctx context.Context, body PostSessionLaunchersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteSessionLaunchersLauncherId request + DeleteSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSessionLaunchersLauncherId request + GetSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchSessionLaunchersLauncherIdWithBody request with any body + PatchSessionLaunchersLauncherIdWithBody(ctx context.Context, launcherId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PatchSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) GetBuildsBuildId(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetBuildsBuildIdRequest(c.Server, buildId) + 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) PatchBuildsBuildIdWithBody(ctx context.Context, buildId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchBuildsBuildIdRequestWithBody(c.Server, buildId, 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) PatchBuildsBuildId(ctx context.Context, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchBuildsBuildIdRequest(c.Server, buildId, 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) GetBuildsBuildIdLogs(ctx context.Context, buildId Ulid, params *GetBuildsBuildIdLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetBuildsBuildIdLogsRequest(c.Server, buildId, 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) GetEnvironments(ctx context.Context, params *GetEnvironmentsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEnvironmentsRequest(c.Server, 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) PostEnvironmentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEnvironmentsRequestWithBody(c.Server, 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) PostEnvironments(ctx context.Context, body PostEnvironmentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEnvironmentsRequest(c.Server, 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) DeleteEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteEnvironmentsEnvironmentIdRequest(c.Server, environmentId) + 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) GetEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEnvironmentsEnvironmentIdRequest(c.Server, environmentId) + 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) PatchEnvironmentsEnvironmentIdWithBody(ctx context.Context, environmentId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchEnvironmentsEnvironmentIdRequestWithBody(c.Server, environmentId, 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) PatchEnvironmentsEnvironmentId(ctx context.Context, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchEnvironmentsEnvironmentIdRequest(c.Server, environmentId, 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) GetEnvironmentsEnvironmentIdBuilds(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEnvironmentsEnvironmentIdBuildsRequest(c.Server, environmentId) + 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) PostEnvironmentsEnvironmentIdBuilds(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEnvironmentsEnvironmentIdBuildsRequest(c.Server, environmentId) + 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) GetProjectsProjectIdSessionLaunchers(ctx context.Context, projectId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetProjectsProjectIdSessionLaunchersRequest(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) GetSessionLaunchers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSessionLaunchersRequest(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) PostSessionLaunchersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSessionLaunchersRequestWithBody(c.Server, 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) PostSessionLaunchers(ctx context.Context, body PostSessionLaunchersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSessionLaunchersRequest(c.Server, 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) DeleteSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteSessionLaunchersLauncherIdRequest(c.Server, launcherId) + 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) GetSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSessionLaunchersLauncherIdRequest(c.Server, launcherId) + 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) PatchSessionLaunchersLauncherIdWithBody(ctx context.Context, launcherId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchSessionLaunchersLauncherIdRequestWithBody(c.Server, launcherId, 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) PatchSessionLaunchersLauncherId(ctx context.Context, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchSessionLaunchersLauncherIdRequest(c.Server, launcherId, 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) +} + +// NewGetBuildsBuildIdRequest generates requests for GetBuildsBuildId +func NewGetBuildsBuildIdRequest(server string, buildId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "build_id", buildId, 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("/builds/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchBuildsBuildIdRequest calls the generic PatchBuildsBuildId builder with application/json body +func NewPatchBuildsBuildIdRequest(server string, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchBuildsBuildIdRequestWithBody(server, buildId, "application/json", bodyReader) +} + +// NewPatchBuildsBuildIdRequestWithBody generates requests for PatchBuildsBuildId with any type of body +func NewPatchBuildsBuildIdRequestWithBody(server string, buildId Ulid, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "build_id", buildId, 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("/builds/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetBuildsBuildIdLogsRequest generates requests for GetBuildsBuildIdLogs +func NewGetBuildsBuildIdLogsRequest(server string, buildId Ulid, params *GetBuildsBuildIdLogsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "build_id", buildId, 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("/builds/%s/logs", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.MaxLines != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "max_lines", *params.MaxLines, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetEnvironmentsRequest generates requests for GetEnvironments +func NewGetEnvironmentsRequest(server string, params *GetEnvironmentsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/environments") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.GetEnvironmentParams != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "get_environment_params", *params.GetEnvironmentParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostEnvironmentsRequest calls the generic PostEnvironments builder with application/json body +func NewPostEnvironmentsRequest(server string, body PostEnvironmentsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostEnvironmentsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostEnvironmentsRequestWithBody generates requests for PostEnvironments with any type of body +func NewPostEnvironmentsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/environments") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteEnvironmentsEnvironmentIdRequest generates requests for DeleteEnvironmentsEnvironmentId +func NewDeleteEnvironmentsEnvironmentIdRequest(server string, environmentId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetEnvironmentsEnvironmentIdRequest generates requests for GetEnvironmentsEnvironmentId +func NewGetEnvironmentsEnvironmentIdRequest(server string, environmentId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchEnvironmentsEnvironmentIdRequest calls the generic PatchEnvironmentsEnvironmentId builder with application/json body +func NewPatchEnvironmentsEnvironmentIdRequest(server string, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchEnvironmentsEnvironmentIdRequestWithBody(server, environmentId, "application/json", bodyReader) +} + +// NewPatchEnvironmentsEnvironmentIdRequestWithBody generates requests for PatchEnvironmentsEnvironmentId with any type of body +func NewPatchEnvironmentsEnvironmentIdRequestWithBody(server string, environmentId Ulid, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetEnvironmentsEnvironmentIdBuildsRequest generates requests for GetEnvironmentsEnvironmentIdBuilds +func NewGetEnvironmentsEnvironmentIdBuildsRequest(server string, environmentId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s/builds", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostEnvironmentsEnvironmentIdBuildsRequest generates requests for PostEnvironmentsEnvironmentIdBuilds +func NewPostEnvironmentsEnvironmentIdBuildsRequest(server string, environmentId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "environment_id", environmentId, 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("/environments/%s/builds", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetProjectsProjectIdSessionLaunchersRequest generates requests for GetProjectsProjectIdSessionLaunchers +func NewGetProjectsProjectIdSessionLaunchersRequest(server string, projectId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "project_id", 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/session_launchers", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetSessionLaunchersRequest generates requests for GetSessionLaunchers +func NewGetSessionLaunchersRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/session_launchers") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostSessionLaunchersRequest calls the generic PostSessionLaunchers builder with application/json body +func NewPostSessionLaunchersRequest(server string, body PostSessionLaunchersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSessionLaunchersRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostSessionLaunchersRequestWithBody generates requests for PostSessionLaunchers with any type of body +func NewPostSessionLaunchersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/session_launchers") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteSessionLaunchersLauncherIdRequest generates requests for DeleteSessionLaunchersLauncherId +func NewDeleteSessionLaunchersLauncherIdRequest(server string, launcherId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "launcher_id", launcherId, 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("/session_launchers/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetSessionLaunchersLauncherIdRequest generates requests for GetSessionLaunchersLauncherId +func NewGetSessionLaunchersLauncherIdRequest(server string, launcherId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "launcher_id", launcherId, 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("/session_launchers/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchSessionLaunchersLauncherIdRequest calls the generic PatchSessionLaunchersLauncherId builder with application/json body +func NewPatchSessionLaunchersLauncherIdRequest(server string, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchSessionLaunchersLauncherIdRequestWithBody(server, launcherId, "application/json", bodyReader) +} + +// NewPatchSessionLaunchersLauncherIdRequestWithBody generates requests for PatchSessionLaunchersLauncherId with any type of body +func NewPatchSessionLaunchersLauncherIdRequestWithBody(server string, launcherId Ulid, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "launcher_id", launcherId, 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("/session_launchers/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + 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 { + // GetBuildsBuildIdWithResponse request + GetBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdResponse, error) + + // PatchBuildsBuildIdWithBodyWithResponse request with any body + PatchBuildsBuildIdWithBodyWithResponse(ctx context.Context, buildId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchBuildsBuildIdResponse, error) + + PatchBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchBuildsBuildIdResponse, error) + + // GetBuildsBuildIdLogsWithResponse request + GetBuildsBuildIdLogsWithResponse(ctx context.Context, buildId Ulid, params *GetBuildsBuildIdLogsParams, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdLogsResponse, error) + + // GetEnvironmentsWithResponse request + GetEnvironmentsWithResponse(ctx context.Context, params *GetEnvironmentsParams, reqEditors ...RequestEditorFn) (*GetEnvironmentsResponse, error) + + // PostEnvironmentsWithBodyWithResponse request with any body + PostEnvironmentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEnvironmentsResponse, error) + + PostEnvironmentsWithResponse(ctx context.Context, body PostEnvironmentsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEnvironmentsResponse, error) + + // DeleteEnvironmentsEnvironmentIdWithResponse request + DeleteEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*DeleteEnvironmentsEnvironmentIdResponse, error) + + // GetEnvironmentsEnvironmentIdWithResponse request + GetEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*GetEnvironmentsEnvironmentIdResponse, error) + + // PatchEnvironmentsEnvironmentIdWithBodyWithResponse request with any body + PatchEnvironmentsEnvironmentIdWithBodyWithResponse(ctx context.Context, environmentId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchEnvironmentsEnvironmentIdResponse, error) + + PatchEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchEnvironmentsEnvironmentIdResponse, error) + + // GetEnvironmentsEnvironmentIdBuildsWithResponse request + GetEnvironmentsEnvironmentIdBuildsWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*GetEnvironmentsEnvironmentIdBuildsResponse, error) + + // PostEnvironmentsEnvironmentIdBuildsWithResponse request + PostEnvironmentsEnvironmentIdBuildsWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*PostEnvironmentsEnvironmentIdBuildsResponse, error) + + // GetProjectsProjectIdSessionLaunchersWithResponse request + GetProjectsProjectIdSessionLaunchersWithResponse(ctx context.Context, projectId Ulid, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdSessionLaunchersResponse, error) + + // GetSessionLaunchersWithResponse request + GetSessionLaunchersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSessionLaunchersResponse, error) + + // PostSessionLaunchersWithBodyWithResponse request with any body + PostSessionLaunchersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionLaunchersResponse, error) + + PostSessionLaunchersWithResponse(ctx context.Context, body PostSessionLaunchersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionLaunchersResponse, error) + + // DeleteSessionLaunchersLauncherIdWithResponse request + DeleteSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*DeleteSessionLaunchersLauncherIdResponse, error) + + // GetSessionLaunchersLauncherIdWithResponse request + GetSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*GetSessionLaunchersLauncherIdResponse, error) + + // PatchSessionLaunchersLauncherIdWithBodyWithResponse request with any body + PatchSessionLaunchersLauncherIdWithBodyWithResponse(ctx context.Context, launcherId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchSessionLaunchersLauncherIdResponse, error) + + PatchSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchSessionLaunchersLauncherIdResponse, error) +} + +type GetBuildsBuildIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Build + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetBuildsBuildIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetBuildsBuildIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PatchBuildsBuildIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Build + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PatchBuildsBuildIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchBuildsBuildIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetBuildsBuildIdLogsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *BuildLogs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetBuildsBuildIdLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetBuildsBuildIdLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEnvironmentsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EnvironmentList + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetEnvironmentsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEnvironmentsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostEnvironmentsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Environment + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PostEnvironmentsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostEnvironmentsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteEnvironmentsEnvironmentIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteEnvironmentsEnvironmentIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteEnvironmentsEnvironmentIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEnvironmentsEnvironmentIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Environment + JSON404 *ErrorResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetEnvironmentsEnvironmentIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEnvironmentsEnvironmentIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PatchEnvironmentsEnvironmentIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Environment + JSON404 *ErrorResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PatchEnvironmentsEnvironmentIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchEnvironmentsEnvironmentIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEnvironmentsEnvironmentIdBuildsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *BuildList + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetEnvironmentsEnvironmentIdBuildsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEnvironmentsEnvironmentIdBuildsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostEnvironmentsEnvironmentIdBuildsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Build + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PostEnvironmentsEnvironmentIdBuildsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostEnvironmentsEnvironmentIdBuildsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetProjectsProjectIdSessionLaunchersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SessionLaunchersList + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetProjectsProjectIdSessionLaunchersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetProjectsProjectIdSessionLaunchersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSessionLaunchersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SessionLaunchersList + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetSessionLaunchersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSessionLaunchersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostSessionLaunchersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *SessionLauncher + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PostSessionLaunchersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostSessionLaunchersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteSessionLaunchersLauncherIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteSessionLaunchersLauncherIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteSessionLaunchersLauncherIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSessionLaunchersLauncherIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SessionLauncher + JSON404 *ErrorResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetSessionLaunchersLauncherIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSessionLaunchersLauncherIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PatchSessionLaunchersLauncherIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SessionLauncher + JSON404 *ErrorResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PatchSessionLaunchersLauncherIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchSessionLaunchersLauncherIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// GetBuildsBuildIdWithResponse request returning *GetBuildsBuildIdResponse +func (c *ClientWithResponses) GetBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdResponse, error) { + rsp, err := c.GetBuildsBuildId(ctx, buildId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetBuildsBuildIdResponse(rsp) +} + +// PatchBuildsBuildIdWithBodyWithResponse request with arbitrary body returning *PatchBuildsBuildIdResponse +func (c *ClientWithResponses) PatchBuildsBuildIdWithBodyWithResponse(ctx context.Context, buildId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchBuildsBuildIdResponse, error) { + rsp, err := c.PatchBuildsBuildIdWithBody(ctx, buildId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchBuildsBuildIdResponse(rsp) +} + +func (c *ClientWithResponses) PatchBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, body PatchBuildsBuildIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchBuildsBuildIdResponse, error) { + rsp, err := c.PatchBuildsBuildId(ctx, buildId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchBuildsBuildIdResponse(rsp) +} + +// GetBuildsBuildIdLogsWithResponse request returning *GetBuildsBuildIdLogsResponse +func (c *ClientWithResponses) GetBuildsBuildIdLogsWithResponse(ctx context.Context, buildId Ulid, params *GetBuildsBuildIdLogsParams, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdLogsResponse, error) { + rsp, err := c.GetBuildsBuildIdLogs(ctx, buildId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetBuildsBuildIdLogsResponse(rsp) +} + +// GetEnvironmentsWithResponse request returning *GetEnvironmentsResponse +func (c *ClientWithResponses) GetEnvironmentsWithResponse(ctx context.Context, params *GetEnvironmentsParams, reqEditors ...RequestEditorFn) (*GetEnvironmentsResponse, error) { + rsp, err := c.GetEnvironments(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEnvironmentsResponse(rsp) +} + +// PostEnvironmentsWithBodyWithResponse request with arbitrary body returning *PostEnvironmentsResponse +func (c *ClientWithResponses) PostEnvironmentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEnvironmentsResponse, error) { + rsp, err := c.PostEnvironmentsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostEnvironmentsResponse(rsp) +} + +func (c *ClientWithResponses) PostEnvironmentsWithResponse(ctx context.Context, body PostEnvironmentsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEnvironmentsResponse, error) { + rsp, err := c.PostEnvironments(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostEnvironmentsResponse(rsp) +} + +// DeleteEnvironmentsEnvironmentIdWithResponse request returning *DeleteEnvironmentsEnvironmentIdResponse +func (c *ClientWithResponses) DeleteEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*DeleteEnvironmentsEnvironmentIdResponse, error) { + rsp, err := c.DeleteEnvironmentsEnvironmentId(ctx, environmentId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteEnvironmentsEnvironmentIdResponse(rsp) +} + +// GetEnvironmentsEnvironmentIdWithResponse request returning *GetEnvironmentsEnvironmentIdResponse +func (c *ClientWithResponses) GetEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*GetEnvironmentsEnvironmentIdResponse, error) { + rsp, err := c.GetEnvironmentsEnvironmentId(ctx, environmentId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEnvironmentsEnvironmentIdResponse(rsp) +} + +// PatchEnvironmentsEnvironmentIdWithBodyWithResponse request with arbitrary body returning *PatchEnvironmentsEnvironmentIdResponse +func (c *ClientWithResponses) PatchEnvironmentsEnvironmentIdWithBodyWithResponse(ctx context.Context, environmentId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchEnvironmentsEnvironmentIdResponse, error) { + rsp, err := c.PatchEnvironmentsEnvironmentIdWithBody(ctx, environmentId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchEnvironmentsEnvironmentIdResponse(rsp) +} + +func (c *ClientWithResponses) PatchEnvironmentsEnvironmentIdWithResponse(ctx context.Context, environmentId Ulid, body PatchEnvironmentsEnvironmentIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchEnvironmentsEnvironmentIdResponse, error) { + rsp, err := c.PatchEnvironmentsEnvironmentId(ctx, environmentId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchEnvironmentsEnvironmentIdResponse(rsp) +} + +// GetEnvironmentsEnvironmentIdBuildsWithResponse request returning *GetEnvironmentsEnvironmentIdBuildsResponse +func (c *ClientWithResponses) GetEnvironmentsEnvironmentIdBuildsWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*GetEnvironmentsEnvironmentIdBuildsResponse, error) { + rsp, err := c.GetEnvironmentsEnvironmentIdBuilds(ctx, environmentId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEnvironmentsEnvironmentIdBuildsResponse(rsp) +} + +// PostEnvironmentsEnvironmentIdBuildsWithResponse request returning *PostEnvironmentsEnvironmentIdBuildsResponse +func (c *ClientWithResponses) PostEnvironmentsEnvironmentIdBuildsWithResponse(ctx context.Context, environmentId Ulid, reqEditors ...RequestEditorFn) (*PostEnvironmentsEnvironmentIdBuildsResponse, error) { + rsp, err := c.PostEnvironmentsEnvironmentIdBuilds(ctx, environmentId, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostEnvironmentsEnvironmentIdBuildsResponse(rsp) +} + +// GetProjectsProjectIdSessionLaunchersWithResponse request returning *GetProjectsProjectIdSessionLaunchersResponse +func (c *ClientWithResponses) GetProjectsProjectIdSessionLaunchersWithResponse(ctx context.Context, projectId Ulid, reqEditors ...RequestEditorFn) (*GetProjectsProjectIdSessionLaunchersResponse, error) { + rsp, err := c.GetProjectsProjectIdSessionLaunchers(ctx, projectId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProjectsProjectIdSessionLaunchersResponse(rsp) +} + +// GetSessionLaunchersWithResponse request returning *GetSessionLaunchersResponse +func (c *ClientWithResponses) GetSessionLaunchersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSessionLaunchersResponse, error) { + rsp, err := c.GetSessionLaunchers(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSessionLaunchersResponse(rsp) +} + +// PostSessionLaunchersWithBodyWithResponse request with arbitrary body returning *PostSessionLaunchersResponse +func (c *ClientWithResponses) PostSessionLaunchersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionLaunchersResponse, error) { + rsp, err := c.PostSessionLaunchersWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSessionLaunchersResponse(rsp) +} + +func (c *ClientWithResponses) PostSessionLaunchersWithResponse(ctx context.Context, body PostSessionLaunchersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionLaunchersResponse, error) { + rsp, err := c.PostSessionLaunchers(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSessionLaunchersResponse(rsp) +} + +// DeleteSessionLaunchersLauncherIdWithResponse request returning *DeleteSessionLaunchersLauncherIdResponse +func (c *ClientWithResponses) DeleteSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*DeleteSessionLaunchersLauncherIdResponse, error) { + rsp, err := c.DeleteSessionLaunchersLauncherId(ctx, launcherId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSessionLaunchersLauncherIdResponse(rsp) +} + +// GetSessionLaunchersLauncherIdWithResponse request returning *GetSessionLaunchersLauncherIdResponse +func (c *ClientWithResponses) GetSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, reqEditors ...RequestEditorFn) (*GetSessionLaunchersLauncherIdResponse, error) { + rsp, err := c.GetSessionLaunchersLauncherId(ctx, launcherId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSessionLaunchersLauncherIdResponse(rsp) +} + +// PatchSessionLaunchersLauncherIdWithBodyWithResponse request with arbitrary body returning *PatchSessionLaunchersLauncherIdResponse +func (c *ClientWithResponses) PatchSessionLaunchersLauncherIdWithBodyWithResponse(ctx context.Context, launcherId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchSessionLaunchersLauncherIdResponse, error) { + rsp, err := c.PatchSessionLaunchersLauncherIdWithBody(ctx, launcherId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchSessionLaunchersLauncherIdResponse(rsp) +} + +func (c *ClientWithResponses) PatchSessionLaunchersLauncherIdWithResponse(ctx context.Context, launcherId Ulid, body PatchSessionLaunchersLauncherIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchSessionLaunchersLauncherIdResponse, error) { + rsp, err := c.PatchSessionLaunchersLauncherId(ctx, launcherId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchSessionLaunchersLauncherIdResponse(rsp) +} + +// ParseGetBuildsBuildIdResponse parses an HTTP response from a GetBuildsBuildIdWithResponse call +func ParseGetBuildsBuildIdResponse(rsp *http.Response) (*GetBuildsBuildIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetBuildsBuildIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Build + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchBuildsBuildIdResponse parses an HTTP response from a PatchBuildsBuildIdWithResponse call +func ParsePatchBuildsBuildIdResponse(rsp *http.Response) (*PatchBuildsBuildIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchBuildsBuildIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Build + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetBuildsBuildIdLogsResponse parses an HTTP response from a GetBuildsBuildIdLogsWithResponse call +func ParseGetBuildsBuildIdLogsResponse(rsp *http.Response) (*GetBuildsBuildIdLogsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetBuildsBuildIdLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BuildLogs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetEnvironmentsResponse parses an HTTP response from a GetEnvironmentsWithResponse call +func ParseGetEnvironmentsResponse(rsp *http.Response) (*GetEnvironmentsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetEnvironmentsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest EnvironmentList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostEnvironmentsResponse parses an HTTP response from a PostEnvironmentsWithResponse call +func ParsePostEnvironmentsResponse(rsp *http.Response) (*PostEnvironmentsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostEnvironmentsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Environment + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteEnvironmentsEnvironmentIdResponse parses an HTTP response from a DeleteEnvironmentsEnvironmentIdWithResponse call +func ParseDeleteEnvironmentsEnvironmentIdResponse(rsp *http.Response) (*DeleteEnvironmentsEnvironmentIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteEnvironmentsEnvironmentIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetEnvironmentsEnvironmentIdResponse parses an HTTP response from a GetEnvironmentsEnvironmentIdWithResponse call +func ParseGetEnvironmentsEnvironmentIdResponse(rsp *http.Response) (*GetEnvironmentsEnvironmentIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetEnvironmentsEnvironmentIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Environment + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchEnvironmentsEnvironmentIdResponse parses an HTTP response from a PatchEnvironmentsEnvironmentIdWithResponse call +func ParsePatchEnvironmentsEnvironmentIdResponse(rsp *http.Response) (*PatchEnvironmentsEnvironmentIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchEnvironmentsEnvironmentIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Environment + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetEnvironmentsEnvironmentIdBuildsResponse parses an HTTP response from a GetEnvironmentsEnvironmentIdBuildsWithResponse call +func ParseGetEnvironmentsEnvironmentIdBuildsResponse(rsp *http.Response) (*GetEnvironmentsEnvironmentIdBuildsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetEnvironmentsEnvironmentIdBuildsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BuildList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostEnvironmentsEnvironmentIdBuildsResponse parses an HTTP response from a PostEnvironmentsEnvironmentIdBuildsWithResponse call +func ParsePostEnvironmentsEnvironmentIdBuildsResponse(rsp *http.Response) (*PostEnvironmentsEnvironmentIdBuildsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostEnvironmentsEnvironmentIdBuildsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Build + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetProjectsProjectIdSessionLaunchersResponse parses an HTTP response from a GetProjectsProjectIdSessionLaunchersWithResponse call +func ParseGetProjectsProjectIdSessionLaunchersResponse(rsp *http.Response) (*GetProjectsProjectIdSessionLaunchersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetProjectsProjectIdSessionLaunchersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SessionLaunchersList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetSessionLaunchersResponse parses an HTTP response from a GetSessionLaunchersWithResponse call +func ParseGetSessionLaunchersResponse(rsp *http.Response) (*GetSessionLaunchersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSessionLaunchersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SessionLaunchersList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostSessionLaunchersResponse parses an HTTP response from a PostSessionLaunchersWithResponse call +func ParsePostSessionLaunchersResponse(rsp *http.Response) (*PostSessionLaunchersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostSessionLaunchersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest SessionLauncher + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteSessionLaunchersLauncherIdResponse parses an HTTP response from a DeleteSessionLaunchersLauncherIdWithResponse call +func ParseDeleteSessionLaunchersLauncherIdResponse(rsp *http.Response) (*DeleteSessionLaunchersLauncherIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteSessionLaunchersLauncherIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetSessionLaunchersLauncherIdResponse parses an HTTP response from a GetSessionLaunchersLauncherIdWithResponse call +func ParseGetSessionLaunchersLauncherIdResponse(rsp *http.Response) (*GetSessionLaunchersLauncherIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSessionLaunchersLauncherIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SessionLauncher + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchSessionLaunchersLauncherIdResponse parses an HTTP response from a PatchSessionLaunchersLauncherIdWithResponse call +func ParsePatchSessionLaunchersLauncherIdResponse(rsp *http.Response) (*PatchSessionLaunchersLauncherIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchSessionLaunchersLauncherIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SessionLauncher + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+x8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dSWE51Y1AOWK1V/I209XF/86/3z66aq8nnTszS/pPchTeoZj6o1BW4x6CekSIDVo3sPq", + "lHSpn3ZPdL8SfN6TBVwecRZH6PQExQJ8xRrF4ZzKakvrBbEgE/iYGk1jJ0N8bz7u7+292stZ4e4CG5qF", + "QRZaTn21A6iJ8xZVMkVXYVPr9o4+7X756eDL5f5vvx3s771+/e7kt+6H7sGBs9JNKtDwmQYP2X5Q1PXV", + "2eriaqwRTnWyJCB9+lylFPntitnnUWeV7+Z7C+9/EJmn2BjCuRnn5nTtGPl24XKyk6U0BDSxze0K0Zep", + "yyc0S9bYOsDPxGaz1LcWPuYC1Pdnn98cnTmuc3x9efX546ppVqW/LfGnaLC7ZgTOlhq0jyym8oRw8NKM", + "jy3TbU4cVWjDjTGOgAsipFLiBR5dZtNDNQP4LopFjIPgARGJxJjFga9+JT5QSTwcaH+XI4wizNWwCaun", + "jN+pOMpPSXQRGaIAhhLFVECydaSOs2T2Tu2i4zxmIXR+Z5MHTDuqbSPTUuRYZmKWD79swHUyPNcmp2PN", + "UlR8UZw4FzURo+nRDolOZ2Z7eJPu6dY/c5/qWamVa+GmeYFlnXMBVvnMZlXHedOZ64wame335vyUiD7m", + "3phMYGXnU3GUtMySvlpN+n5eE2tObwPkzM0ikGWjXBr06GP2metEjMsmkmY8ORvlJOqroLUfcRiS+5XT", + "qg7nWI7PdfOM5LgR268N2xNlX4t1v5q+Zeat2O/nCvKX9NgXBMS23aGgy381N77pOouOfeNIM0Xxo+1E", + "qR8VDjQbHFVkyrHZA4ryiHekkZHXPpJFT0rO3HliUKq4uTo+R8rcoBeMIkwf8hnMQoTyMvE6YgE8PdQQ", + "c6SxWJrAZshZaABG0yPoeWSThjIGCDUint2kVqJexJO6/pZDx9SX13jWycbtbNrr79db3Krr6VB+077N", + "xkgTnE/axzerM9kyE/egsYnQjkJ+ib1ut1v1HOqNO/chimNqf3GDDsUTfYnmdlR7FfkVve6+7i5yM+oN", + "X3I47AyL15Tq9QKpbtIxsedxqxrrNjljrtiwJ6a2ikN8gCDSlrLZdqdMaXUbsQy8HraEXHH2v+5GuOic", + "X4+3Mv97vSiBp7e9b5u/K2Qat5lzf6JntJEdaytlH3bXqjEfDbYKW2KSWioDrsLJJQtz14BnIWm9zlK2", + "XnBjFeg34PzG2VxVHEuO8ALoXYx22t3v15VMTub7fnI036Ti5C+T8aldW79Wbsj5fry4TWSENu+qPV+i", + "yH6VIXXKCthPmGiINkArInyFY1aZum6OvpCIFxJzWc6dE3v6PO1oUjVbTabbE3BrpNNz91EWXFdQv6Hp", + "+GFRzRzyiY8okyi5waGZhSeY6CRScdGXEqLPsfw8/AihKV9eRFFy36pyLgjp5a5yGYJfLBvp7XZ3l/h4", + "S306HyQmQZGbRyhkHJD5CXzEInPigEIQQvFCjNlUiXs6xtIc9XA2CCBEUyxs60z6FWe5ZCHIsR4GqERT", + "zugItVAUABaAJH9AeIQJRQGW+sJIZVTJsQd9m1N8CVT11w2UYzxkHAWEaojqnCE3N9V09V3ARki1J8Wa", + "Igd7B68O9rpwAL3eLt7b8/Z/Gg5ewx4M93oHgwGsvL+g5TRffFWFy26CFrdN08vF25UFXwvgPwiUtkPH", + "Y0Y8aF5EmNtX9Bx5k1o+Xvp1DHIMHMkxEYUTeyJQuo/pWjmlL7quXgAiFFGYKryotQnEuPp5zsoBYwFg", + "WqRlQcH+tgm4KBS5l92rEZFoXjiKri/ObBi13HBYOFbye+P7WIsq5JtPZBnaeKrHARbidEH4aY5nhwS4", + "qTbOiic91cupU12XeBT5zMJqd9aHIaH6MFRLOQSJfSyxY70jub6bua636BNx1xfzoselXXP1kSY+6U/y", + "hXarq+SStsXgpom3WihaauS3ruMyGvVrcPE0BVVfg6pGxzJ0rc5Yjo6FnlkxaqrSYTPYJTxv5PQ+SIVT", + "xvc3h2j+uGljOG2eSSydxzUpMMpVfun4eg0IbwSQK4GTXmCqj5vVJ0o5IOVun5bEodazrNAuY5pjDPMF", + "usyyjXntzo2x99un7rudvU+vTt4c7F7tXiS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b/TfMf9isfNL661l5PbPnQoZ5PMPfEkKyRFBtVMxci4J1", + "guQ5q1papt++qqCruvSkgAjROByY/G/IhGwpB4BK/RiVtjQcZMzN1XFlsedLUUGYGuuPGPQRWYLZEN/3", + "dWcnD9KMjTt7lrMsBdDtyl8zZQEGzPGg5vGmTMLqx8Oe1x4omBUuni0B19viBbUSlXAfBfpQ05BhQ8QI", + "ZD9fLKNHKMKjwTNmiXNUqLeoedqVgTk7YsrzYPF5ki3bJ+SD3lPNCzDbxG/5TqEFxWdJumQUsEHx2ZLN", + "QFrFILax5zAufK3BbK2ZvzCoFQj7IaEoAh4SEwg5bnlnYqIMvW3sS5Xq0TqbU28b0y98tLVaApZ/2+TJ", + "Aj5Ok8wUpqmU7WVnC4RdNiadx+KbnzODgwDMEV5RzCf6+7ygixem65jFyhOjT3WWSuLeXfDwyQLBpOE7", + "41nNCdwrDU3iwCHhQqIowB48WXgXei6E1xKcW8vmf3/y6D6z+imp7RpUfMO3my1o8xmIOb42Y+rXRFJk", + "T481MfhqhO8OeNvdcZ4jHqqBeS1M8P+bsJ+EaiICjwyJh4YEAt/48NRMQehoO9tjEvDV9cELavEmfTR5", + "y+HTCsdzwVvOmzFIFm7/ILIjwuzZ6LUiqo1bjNTvXe7M1pJh79ukQEz4uzWPslHqI019dh7nx8qzTgKA", + "/vz8d4mqnCdDJP+f+uUz51o7SeFU+7t1X6zH6UvUNDt1mnNyMyqasOsHYT2rT0VdlaOReiP5WsT5H8/f", + "INBnA2uwd5lBsnJy8/6OrS7qG0fZlTqQ5W5GysDtGUVLPVdjJek8pn/Wi7ErYE7+qOlb5yb75hH2s0XV", + "DeXk1rZa3xPzu8+tZ88aU2TKvpVgujGAlp3TfWcg2v5W8RzhcU0Ml0Pk/2gs1wuOm25qagpdumIQq28D", + "Ox0ckY6+CzK7nf1fAAAA//9oBWzgQG0AAA==", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %w", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + res := make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + resolvePath := PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + pathToFile := url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/pkg/renkuapi/users/users_gen.go b/pkg/renkuapi/users/users_gen.go new file mode 100644 index 0000000..f8d0c54 --- /dev/null +++ b/pkg/renkuapi/users/users_gen.go @@ -0,0 +1,2597 @@ +// Package users provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT. +package users + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "path" + "strings" + "time" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/oapi-codegen/runtime" +) + +const ( + OidcScopes = "oidc.Scopes" +) + +// Defines values for SecretKind. +const ( + General SecretKind = "general" + Storage SecretKind = "storage" +) + +// Valid indicates whether the value is a known member of the SecretKind enum. +func (e SecretKind) Valid() bool { + switch e { + case General: + return true + case Storage: + return true + default: + return false + } +} + +// AddPinnedProject defines model for AddPinnedProject. +type AddPinnedProject struct { + // ProjectSlug The slug used to identify a project + ProjectSlug ProjectSlug `json:"project_slug"` +} + +// ErrorResponse defines model for ErrorResponse. +type ErrorResponse struct { + Error struct { + Code int `json:"code"` + Detail *string `json:"detail,omitempty"` + Message string `json:"message"` + + // TraceId Sentry trace ID for linking to corresponding log entries + TraceId *string `json:"trace_id,omitempty"` + } `json:"error"` +} + +// ExpirationTimestamp The date and time the secret is not valid anymore (this is in any timezone) +type ExpirationTimestamp = time.Time + +// ModificationDate The date and time the secret was created or modified (this is always in UTC) +type ModificationDate = time.Time + +// PinnedProjects The list of projects a user has pinned on their dashboard +type PinnedProjects struct { + ProjectSlugs *[]ProjectSlugResponse `json:"project_slugs,omitempty"` +} + +// ProjectSlug The slug used to identify a project +type ProjectSlug = string + +// ProjectSlugResponse The slug used to identify a project +type ProjectSlugResponse = string + +// SecretDefaultFilename Filename to give to this secret when mounted in Renku 1.0 sessions +type SecretDefaultFilename = string + +// SecretKind Kind of secret +type SecretKind string + +// SecretName The name of a user secret +type SecretName = string + +// SecretPatch Secret metadata to be modified +type SecretPatch struct { + // DefaultFilename Filename to give to this secret when mounted in Renku 1.0 sessions + DefaultFilename *SecretDefaultFilename `json:"default_filename,omitempty"` + + // ExpirationTimestamp The date and time the secret is not valid anymore (this is in any timezone) + ExpirationTimestamp *ExpirationTimestamp `json:"expiration_timestamp,omitempty"` + + // Name The name of a user secret + Name *SecretName `json:"name,omitempty"` + + // Value Secret value that can be any text + Value *SecretValue `json:"value,omitempty"` +} + +// SecretPost Secret metadata to be created +type SecretPost struct { + // DefaultFilename Filename to give to this secret when mounted in Renku 1.0 sessions + DefaultFilename *SecretDefaultFilename `json:"default_filename,omitempty"` + + // ExpirationTimestamp The date and time the secret is not valid anymore (this is in any timezone) + ExpirationTimestamp *ExpirationTimestamp `json:"expiration_timestamp,omitempty"` + Kind *SecretKind `json:"kind,omitempty"` + + // Name The name of a user secret + Name SecretName `json:"name"` + + // Value Secret value that can be any text + Value SecretValue `json:"value"` +} + +// SecretValue Secret value that can be any text +type SecretValue = string + +// SecretWithId A Renku secret +type SecretWithId struct { + DataConnectorIds UlidList `json:"data_connector_ids"` + + // DefaultFilename Filename to give to this secret when mounted in Renku 1.0 sessions + DefaultFilename SecretDefaultFilename `json:"default_filename"` + + // ExpirationTimestamp The date and time the secret is not valid anymore (this is in any timezone) + ExpirationTimestamp *ExpirationTimestamp `json:"expiration_timestamp,omitempty"` + + // Id ULID identifier + Id Ulid `json:"id"` + + // Kind Kind of secret + Kind SecretKind `json:"kind"` + + // ModificationDate The date and time the secret was created or modified (this is always in UTC) + ModificationDate ModificationDate `json:"modification_date"` + + // Name The name of a user secret + Name SecretName `json:"name"` + SessionSecretSlotIds UlidList `json:"session_secret_slot_ids"` +} + +// SecretsList A list of secrets +type SecretsList = []SecretWithId + +// SelfUserInfo Information about the currently logged in user +type SelfUserInfo struct { + // Email User email + Email *UserEmail `json:"email,omitempty"` + + // FirstName First or last name of the user + FirstName *UserFirstLastName `json:"first_name,omitempty"` + + // Id Keycloak user ID + Id UserId `json:"id"` + + // IsAdmin Whether the user is a platform administrator or not + IsAdmin bool `json:"is_admin"` + + // LastName First or last name of the user + LastName *UserFirstLastName `json:"last_name,omitempty"` + + // Username Handle of the user + Username Username `json:"username"` +} + +// ShowProjectMigrationBanner Should display project migration banner +type ShowProjectMigrationBanner = bool + +// Ulid ULID identifier +type Ulid = string + +// UlidList defines model for UlidList. +type UlidList = []Ulid + +// UserEmail User email +type UserEmail = string + +// UserFirstLastName First or last name of the user +type UserFirstLastName = string + +// UserId Keycloak user ID +type UserId = string + +// UserPreferences The object containing user preferences +type UserPreferences struct { + // PinnedProjects The list of projects a user has pinned on their dashboard + PinnedProjects PinnedProjects `json:"pinned_projects"` + + // ShowProjectMigrationBanner Should display project migration banner + ShowProjectMigrationBanner *ShowProjectMigrationBanner `json:"show_project_migration_banner,omitempty"` + + // UserId Keycloak user ID + UserId UserId `json:"user_id"` +} + +// UserSecretKey defines model for UserSecretKey. +type UserSecretKey struct { + // SecretKey The users secret key + SecretKey *string `json:"secret_key,omitempty"` +} + +// UserWithId defines model for UserWithId. +type UserWithId struct { + // Email User email + Email *UserEmail `json:"email,omitempty"` + + // FirstName First or last name of the user + FirstName *UserFirstLastName `json:"first_name,omitempty"` + + // Id Keycloak user ID + Id UserId `json:"id"` + + // LastName First or last name of the user + LastName *UserFirstLastName `json:"last_name,omitempty"` + + // Username Handle of the user + Username Username `json:"username"` +} + +// Username Handle of the user +type Username = string + +// UsersWithId defines model for UsersWithId. +type UsersWithId = []UserWithId + +// Version defines model for Version. +type Version struct { + Version string `json:"version"` +} + +// Error defines model for Error. +type Error = ErrorResponse + +// DeleteUserPreferencesPinnedProjectsParams defines parameters for DeleteUserPreferencesPinnedProjects. +type DeleteUserPreferencesPinnedProjectsParams struct { + // DeletePinnedParams query parameters + DeletePinnedParams *struct { + ProjectSlug *string `json:"project_slug,omitempty"` + } `form:"delete_pinned_params,omitempty" json:"delete_pinned_params,omitempty"` +} + +// GetUserSecretsParams defines parameters for GetUserSecrets. +type GetUserSecretsParams struct { + UserSecretsParams *struct { + // Kind Kind of secret + Kind *SecretKind `json:"kind,omitempty"` + } `form:"user_secrets_params,omitempty" json:"user_secrets_params,omitempty"` +} + +// GetUsersParams defines parameters for GetUsers. +type GetUsersParams struct { + UserParams *struct { + // ExactEmail Return the user(s) with an exact match on the email provided + ExactEmail *string `json:"exact_email,omitempty"` + } `form:"user_params,omitempty" json:"user_params,omitempty"` +} + +// PostUserPreferencesPinnedProjectsJSONRequestBody defines body for PostUserPreferencesPinnedProjects for application/json ContentType. +type PostUserPreferencesPinnedProjectsJSONRequestBody = AddPinnedProject + +// PostUserSecretsJSONRequestBody defines body for PostUserSecrets for application/json ContentType. +type PostUserSecretsJSONRequestBody = SecretPost + +// PatchUserSecretsSecretIdJSONRequestBody defines body for PatchUserSecretsSecretId for application/json ContentType. +type PatchUserSecretsSecretIdJSONRequestBody = SecretPatch + +// 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 { + // GetError request + GetError(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUser request + GetUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUserPreferences request + GetUserPreferences(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteUserPreferencesDismissProjectMigrationBanner request + DeleteUserPreferencesDismissProjectMigrationBanner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostUserPreferencesDismissProjectMigrationBanner request + PostUserPreferencesDismissProjectMigrationBanner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteUserPreferencesPinnedProjects request + DeleteUserPreferencesPinnedProjects(ctx context.Context, params *DeleteUserPreferencesPinnedProjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostUserPreferencesPinnedProjectsWithBody request with any body + PostUserPreferencesPinnedProjectsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostUserPreferencesPinnedProjects(ctx context.Context, body PostUserPreferencesPinnedProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUserSecretKey request + GetUserSecretKey(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUserSecrets request + GetUserSecrets(ctx context.Context, params *GetUserSecretsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostUserSecretsWithBody request with any body + PostUserSecretsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostUserSecrets(ctx context.Context, body PostUserSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteUserSecretsSecretId request + DeleteUserSecretsSecretId(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUserSecretsSecretId request + GetUserSecretsSecretId(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchUserSecretsSecretIdWithBody request with any body + PatchUserSecretsSecretIdWithBody(ctx context.Context, secretId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PatchUserSecretsSecretId(ctx context.Context, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUsers request + GetUsers(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteUsersUserId request + DeleteUsersUserId(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUsersUserId request + GetUsersUserId(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetVersion request + GetVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) GetError(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetErrorRequest(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, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUserRequest(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) GetUserPreferences(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUserPreferencesRequest(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) DeleteUserPreferencesDismissProjectMigrationBanner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteUserPreferencesDismissProjectMigrationBannerRequest(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) PostUserPreferencesDismissProjectMigrationBanner(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostUserPreferencesDismissProjectMigrationBannerRequest(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) DeleteUserPreferencesPinnedProjects(ctx context.Context, params *DeleteUserPreferencesPinnedProjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteUserPreferencesPinnedProjectsRequest(c.Server, 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) PostUserPreferencesPinnedProjectsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostUserPreferencesPinnedProjectsRequestWithBody(c.Server, 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) PostUserPreferencesPinnedProjects(ctx context.Context, body PostUserPreferencesPinnedProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostUserPreferencesPinnedProjectsRequest(c.Server, 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) GetUserSecretKey(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUserSecretKeyRequest(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) GetUserSecrets(ctx context.Context, params *GetUserSecretsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUserSecretsRequest(c.Server, 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) PostUserSecretsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostUserSecretsRequestWithBody(c.Server, 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) PostUserSecrets(ctx context.Context, body PostUserSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostUserSecretsRequest(c.Server, 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) DeleteUserSecretsSecretId(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteUserSecretsSecretIdRequest(c.Server, secretId) + 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) GetUserSecretsSecretId(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUserSecretsSecretIdRequest(c.Server, secretId) + 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) PatchUserSecretsSecretIdWithBody(ctx context.Context, secretId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchUserSecretsSecretIdRequestWithBody(c.Server, secretId, 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) PatchUserSecretsSecretId(ctx context.Context, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchUserSecretsSecretIdRequest(c.Server, secretId, 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) GetUsers(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUsersRequest(c.Server, 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) DeleteUsersUserId(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteUsersUserIdRequest(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) GetUsersUserId(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUsersUserIdRequest(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) GetVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetVersionRequest(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) +} + +// NewGetErrorRequest generates requests for GetError +func NewGetErrorRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/error") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetUserRequest generates requests for GetUser +func NewGetUserRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetUserPreferencesRequest generates requests for GetUserPreferences +func NewGetUserPreferencesRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/preferences") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteUserPreferencesDismissProjectMigrationBannerRequest generates requests for DeleteUserPreferencesDismissProjectMigrationBanner +func NewDeleteUserPreferencesDismissProjectMigrationBannerRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/preferences/dismiss_project_migration_banner") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostUserPreferencesDismissProjectMigrationBannerRequest generates requests for PostUserPreferencesDismissProjectMigrationBanner +func NewPostUserPreferencesDismissProjectMigrationBannerRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/preferences/dismiss_project_migration_banner") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteUserPreferencesPinnedProjectsRequest generates requests for DeleteUserPreferencesPinnedProjects +func NewDeleteUserPreferencesPinnedProjectsRequest(server string, params *DeleteUserPreferencesPinnedProjectsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/preferences/pinned_projects") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.DeletePinnedParams != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "delete_pinned_params", *params.DeletePinnedParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostUserPreferencesPinnedProjectsRequest calls the generic PostUserPreferencesPinnedProjects builder with application/json body +func NewPostUserPreferencesPinnedProjectsRequest(server string, body PostUserPreferencesPinnedProjectsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostUserPreferencesPinnedProjectsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostUserPreferencesPinnedProjectsRequestWithBody generates requests for PostUserPreferencesPinnedProjects with any type of body +func NewPostUserPreferencesPinnedProjectsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/preferences/pinned_projects") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetUserSecretKeyRequest generates requests for GetUserSecretKey +func NewGetUserSecretKeyRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/secret_key") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetUserSecretsRequest generates requests for GetUserSecrets +func NewGetUserSecretsRequest(server string, params *GetUserSecretsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/secrets") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.UserSecretsParams != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "user_secrets_params", *params.UserSecretsParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostUserSecretsRequest calls the generic PostUserSecrets builder with application/json body +func NewPostUserSecretsRequest(server string, body PostUserSecretsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostUserSecretsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostUserSecretsRequestWithBody generates requests for PostUserSecrets with any type of body +func NewPostUserSecretsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/secrets") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteUserSecretsSecretIdRequest generates requests for DeleteUserSecretsSecretId +func NewDeleteUserSecretsSecretIdRequest(server string, secretId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secret_id", secretId, 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("/user/secrets/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetUserSecretsSecretIdRequest generates requests for GetUserSecretsSecretId +func NewGetUserSecretsSecretIdRequest(server string, secretId Ulid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secret_id", secretId, 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("/user/secrets/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPatchUserSecretsSecretIdRequest calls the generic PatchUserSecretsSecretId builder with application/json body +func NewPatchUserSecretsSecretIdRequest(server string, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchUserSecretsSecretIdRequestWithBody(server, secretId, "application/json", bodyReader) +} + +// NewPatchUserSecretsSecretIdRequestWithBody generates requests for PatchUserSecretsSecretId with any type of body +func NewPatchUserSecretsSecretIdRequestWithBody(server string, secretId Ulid, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "secret_id", secretId, 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("/user/secrets/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetUsersRequest generates requests for GetUsers +func NewGetUsersRequest(server string, params *GetUsersParams) (*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 + } + + if params != nil { + queryValues := queryURL.Query() + + if params.UserParams != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "user_params", *params.UserParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteUsersUserIdRequest generates requests for DeleteUsersUserId +func NewDeleteUsersUserIdRequest(server string, userId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "user_id", 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("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetUsersUserIdRequest generates requests for GetUsersUserId +func NewGetUsersUserIdRequest(server string, userId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "user_id", 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("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetVersionRequest generates requests for GetVersion +func NewGetVersionRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/version") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", 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 { + // GetErrorWithResponse request + GetErrorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetErrorResponse, error) + + // GetUserWithResponse request + GetUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserResponse, error) + + // GetUserPreferencesWithResponse request + GetUserPreferencesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserPreferencesResponse, error) + + // DeleteUserPreferencesDismissProjectMigrationBannerWithResponse request + DeleteUserPreferencesDismissProjectMigrationBannerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DeleteUserPreferencesDismissProjectMigrationBannerResponse, error) + + // PostUserPreferencesDismissProjectMigrationBannerWithResponse request + PostUserPreferencesDismissProjectMigrationBannerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostUserPreferencesDismissProjectMigrationBannerResponse, error) + + // DeleteUserPreferencesPinnedProjectsWithResponse request + DeleteUserPreferencesPinnedProjectsWithResponse(ctx context.Context, params *DeleteUserPreferencesPinnedProjectsParams, reqEditors ...RequestEditorFn) (*DeleteUserPreferencesPinnedProjectsResponse, error) + + // PostUserPreferencesPinnedProjectsWithBodyWithResponse request with any body + PostUserPreferencesPinnedProjectsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserPreferencesPinnedProjectsResponse, error) + + PostUserPreferencesPinnedProjectsWithResponse(ctx context.Context, body PostUserPreferencesPinnedProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserPreferencesPinnedProjectsResponse, error) + + // GetUserSecretKeyWithResponse request + GetUserSecretKeyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserSecretKeyResponse, error) + + // GetUserSecretsWithResponse request + GetUserSecretsWithResponse(ctx context.Context, params *GetUserSecretsParams, reqEditors ...RequestEditorFn) (*GetUserSecretsResponse, error) + + // PostUserSecretsWithBodyWithResponse request with any body + PostUserSecretsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserSecretsResponse, error) + + PostUserSecretsWithResponse(ctx context.Context, body PostUserSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserSecretsResponse, error) + + // DeleteUserSecretsSecretIdWithResponse request + DeleteUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*DeleteUserSecretsSecretIdResponse, error) + + // GetUserSecretsSecretIdWithResponse request + GetUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*GetUserSecretsSecretIdResponse, error) + + // PatchUserSecretsSecretIdWithBodyWithResponse request with any body + PatchUserSecretsSecretIdWithBodyWithResponse(ctx context.Context, secretId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchUserSecretsSecretIdResponse, error) + + PatchUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchUserSecretsSecretIdResponse, error) + + // GetUsersWithResponse request + GetUsersWithResponse(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*GetUsersResponse, error) + + // DeleteUsersUserIdWithResponse request + DeleteUsersUserIdWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*DeleteUsersUserIdResponse, error) + + // GetUsersUserIdWithResponse request + GetUsersUserIdWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetUsersUserIdResponse, error) + + // GetVersionWithResponse request + GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) +} + +type GetErrorResponse struct { + Body []byte + HTTPResponse *http.Response + JSON422 *ErrorResponse +} + +// Status returns HTTPResponse.Status +func (r GetErrorResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetErrorResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SelfUserInfo + JSONDefault *Error +} + +// 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 +} + +type GetUserPreferencesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UserPreferences + JSON404 *ErrorResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetUserPreferencesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUserPreferencesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteUserPreferencesDismissProjectMigrationBannerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UserPreferences + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteUserPreferencesDismissProjectMigrationBannerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteUserPreferencesDismissProjectMigrationBannerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostUserPreferencesDismissProjectMigrationBannerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UserPreferences + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PostUserPreferencesDismissProjectMigrationBannerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostUserPreferencesDismissProjectMigrationBannerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteUserPreferencesPinnedProjectsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UserPreferences + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteUserPreferencesPinnedProjectsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteUserPreferencesPinnedProjectsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostUserPreferencesPinnedProjectsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UserPreferences + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PostUserPreferencesPinnedProjectsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostUserPreferencesPinnedProjectsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetUserSecretKeyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UserSecretKey + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetUserSecretKeyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUserSecretKeyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetUserSecretsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SecretsList + JSON404 *ErrorResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetUserSecretsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUserSecretsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostUserSecretsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *SecretWithId + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PostUserSecretsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostUserSecretsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteUserSecretsSecretIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteUserSecretsSecretIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteUserSecretsSecretIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetUserSecretsSecretIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SecretWithId + JSON404 *ErrorResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetUserSecretsSecretIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUserSecretsSecretIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PatchUserSecretsSecretIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *SecretWithId + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r PatchUserSecretsSecretIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PatchUserSecretsSecretIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetUsersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UsersWithId + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetUsersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUsersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteUsersUserIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteUsersUserIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteUsersUserIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetUsersUserIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UserWithId + JSON404 *ErrorResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r GetUsersUserIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUsersUserIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetVersionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Version +} + +// Status returns HTTPResponse.Status +func (r GetVersionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetVersionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// GetErrorWithResponse request returning *GetErrorResponse +func (c *ClientWithResponses) GetErrorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetErrorResponse, error) { + rsp, err := c.GetError(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetErrorResponse(rsp) +} + +// GetUserWithResponse request returning *GetUserResponse +func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserResponse, error) { + rsp, err := c.GetUser(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUserResponse(rsp) +} + +// GetUserPreferencesWithResponse request returning *GetUserPreferencesResponse +func (c *ClientWithResponses) GetUserPreferencesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserPreferencesResponse, error) { + rsp, err := c.GetUserPreferences(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUserPreferencesResponse(rsp) +} + +// DeleteUserPreferencesDismissProjectMigrationBannerWithResponse request returning *DeleteUserPreferencesDismissProjectMigrationBannerResponse +func (c *ClientWithResponses) DeleteUserPreferencesDismissProjectMigrationBannerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DeleteUserPreferencesDismissProjectMigrationBannerResponse, error) { + rsp, err := c.DeleteUserPreferencesDismissProjectMigrationBanner(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteUserPreferencesDismissProjectMigrationBannerResponse(rsp) +} + +// PostUserPreferencesDismissProjectMigrationBannerWithResponse request returning *PostUserPreferencesDismissProjectMigrationBannerResponse +func (c *ClientWithResponses) PostUserPreferencesDismissProjectMigrationBannerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostUserPreferencesDismissProjectMigrationBannerResponse, error) { + rsp, err := c.PostUserPreferencesDismissProjectMigrationBanner(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostUserPreferencesDismissProjectMigrationBannerResponse(rsp) +} + +// DeleteUserPreferencesPinnedProjectsWithResponse request returning *DeleteUserPreferencesPinnedProjectsResponse +func (c *ClientWithResponses) DeleteUserPreferencesPinnedProjectsWithResponse(ctx context.Context, params *DeleteUserPreferencesPinnedProjectsParams, reqEditors ...RequestEditorFn) (*DeleteUserPreferencesPinnedProjectsResponse, error) { + rsp, err := c.DeleteUserPreferencesPinnedProjects(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteUserPreferencesPinnedProjectsResponse(rsp) +} + +// PostUserPreferencesPinnedProjectsWithBodyWithResponse request with arbitrary body returning *PostUserPreferencesPinnedProjectsResponse +func (c *ClientWithResponses) PostUserPreferencesPinnedProjectsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserPreferencesPinnedProjectsResponse, error) { + rsp, err := c.PostUserPreferencesPinnedProjectsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostUserPreferencesPinnedProjectsResponse(rsp) +} + +func (c *ClientWithResponses) PostUserPreferencesPinnedProjectsWithResponse(ctx context.Context, body PostUserPreferencesPinnedProjectsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserPreferencesPinnedProjectsResponse, error) { + rsp, err := c.PostUserPreferencesPinnedProjects(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostUserPreferencesPinnedProjectsResponse(rsp) +} + +// GetUserSecretKeyWithResponse request returning *GetUserSecretKeyResponse +func (c *ClientWithResponses) GetUserSecretKeyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserSecretKeyResponse, error) { + rsp, err := c.GetUserSecretKey(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUserSecretKeyResponse(rsp) +} + +// GetUserSecretsWithResponse request returning *GetUserSecretsResponse +func (c *ClientWithResponses) GetUserSecretsWithResponse(ctx context.Context, params *GetUserSecretsParams, reqEditors ...RequestEditorFn) (*GetUserSecretsResponse, error) { + rsp, err := c.GetUserSecrets(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUserSecretsResponse(rsp) +} + +// PostUserSecretsWithBodyWithResponse request with arbitrary body returning *PostUserSecretsResponse +func (c *ClientWithResponses) PostUserSecretsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUserSecretsResponse, error) { + rsp, err := c.PostUserSecretsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostUserSecretsResponse(rsp) +} + +func (c *ClientWithResponses) PostUserSecretsWithResponse(ctx context.Context, body PostUserSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUserSecretsResponse, error) { + rsp, err := c.PostUserSecrets(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostUserSecretsResponse(rsp) +} + +// DeleteUserSecretsSecretIdWithResponse request returning *DeleteUserSecretsSecretIdResponse +func (c *ClientWithResponses) DeleteUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*DeleteUserSecretsSecretIdResponse, error) { + rsp, err := c.DeleteUserSecretsSecretId(ctx, secretId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteUserSecretsSecretIdResponse(rsp) +} + +// GetUserSecretsSecretIdWithResponse request returning *GetUserSecretsSecretIdResponse +func (c *ClientWithResponses) GetUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, reqEditors ...RequestEditorFn) (*GetUserSecretsSecretIdResponse, error) { + rsp, err := c.GetUserSecretsSecretId(ctx, secretId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUserSecretsSecretIdResponse(rsp) +} + +// PatchUserSecretsSecretIdWithBodyWithResponse request with arbitrary body returning *PatchUserSecretsSecretIdResponse +func (c *ClientWithResponses) PatchUserSecretsSecretIdWithBodyWithResponse(ctx context.Context, secretId Ulid, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchUserSecretsSecretIdResponse, error) { + rsp, err := c.PatchUserSecretsSecretIdWithBody(ctx, secretId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchUserSecretsSecretIdResponse(rsp) +} + +func (c *ClientWithResponses) PatchUserSecretsSecretIdWithResponse(ctx context.Context, secretId Ulid, body PatchUserSecretsSecretIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchUserSecretsSecretIdResponse, error) { + rsp, err := c.PatchUserSecretsSecretId(ctx, secretId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchUserSecretsSecretIdResponse(rsp) +} + +// GetUsersWithResponse request returning *GetUsersResponse +func (c *ClientWithResponses) GetUsersWithResponse(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*GetUsersResponse, error) { + rsp, err := c.GetUsers(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUsersResponse(rsp) +} + +// DeleteUsersUserIdWithResponse request returning *DeleteUsersUserIdResponse +func (c *ClientWithResponses) DeleteUsersUserIdWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*DeleteUsersUserIdResponse, error) { + rsp, err := c.DeleteUsersUserId(ctx, userId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteUsersUserIdResponse(rsp) +} + +// GetUsersUserIdWithResponse request returning *GetUsersUserIdResponse +func (c *ClientWithResponses) GetUsersUserIdWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*GetUsersUserIdResponse, error) { + rsp, err := c.GetUsersUserId(ctx, userId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUsersUserIdResponse(rsp) +} + +// GetVersionWithResponse request returning *GetVersionResponse +func (c *ClientWithResponses) GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) { + rsp, err := c.GetVersion(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetVersionResponse(rsp) +} + +// ParseGetErrorResponse parses an HTTP response from a GetErrorWithResponse call +func ParseGetErrorResponse(rsp *http.Response) (*GetErrorResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetErrorResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &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 == 200: + var dest SelfUserInfo + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUserPreferencesResponse parses an HTTP response from a GetUserPreferencesWithResponse call +func ParseGetUserPreferencesResponse(rsp *http.Response) (*GetUserPreferencesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetUserPreferencesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UserPreferences + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteUserPreferencesDismissProjectMigrationBannerResponse parses an HTTP response from a DeleteUserPreferencesDismissProjectMigrationBannerWithResponse call +func ParseDeleteUserPreferencesDismissProjectMigrationBannerResponse(rsp *http.Response) (*DeleteUserPreferencesDismissProjectMigrationBannerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteUserPreferencesDismissProjectMigrationBannerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UserPreferences + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostUserPreferencesDismissProjectMigrationBannerResponse parses an HTTP response from a PostUserPreferencesDismissProjectMigrationBannerWithResponse call +func ParsePostUserPreferencesDismissProjectMigrationBannerResponse(rsp *http.Response) (*PostUserPreferencesDismissProjectMigrationBannerResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostUserPreferencesDismissProjectMigrationBannerResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UserPreferences + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteUserPreferencesPinnedProjectsResponse parses an HTTP response from a DeleteUserPreferencesPinnedProjectsWithResponse call +func ParseDeleteUserPreferencesPinnedProjectsResponse(rsp *http.Response) (*DeleteUserPreferencesPinnedProjectsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteUserPreferencesPinnedProjectsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UserPreferences + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostUserPreferencesPinnedProjectsResponse parses an HTTP response from a PostUserPreferencesPinnedProjectsWithResponse call +func ParsePostUserPreferencesPinnedProjectsResponse(rsp *http.Response) (*PostUserPreferencesPinnedProjectsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostUserPreferencesPinnedProjectsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UserPreferences + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUserSecretKeyResponse parses an HTTP response from a GetUserSecretKeyWithResponse call +func ParseGetUserSecretKeyResponse(rsp *http.Response) (*GetUserSecretKeyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetUserSecretKeyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UserSecretKey + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUserSecretsResponse parses an HTTP response from a GetUserSecretsWithResponse call +func ParseGetUserSecretsResponse(rsp *http.Response) (*GetUserSecretsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetUserSecretsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SecretsList + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostUserSecretsResponse parses an HTTP response from a PostUserSecretsWithResponse call +func ParsePostUserSecretsResponse(rsp *http.Response) (*PostUserSecretsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostUserSecretsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest SecretWithId + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteUserSecretsSecretIdResponse parses an HTTP response from a DeleteUserSecretsSecretIdWithResponse call +func ParseDeleteUserSecretsSecretIdResponse(rsp *http.Response) (*DeleteUserSecretsSecretIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteUserSecretsSecretIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUserSecretsSecretIdResponse parses an HTTP response from a GetUserSecretsSecretIdWithResponse call +func ParseGetUserSecretsSecretIdResponse(rsp *http.Response) (*GetUserSecretsSecretIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetUserSecretsSecretIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SecretWithId + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchUserSecretsSecretIdResponse parses an HTTP response from a PatchUserSecretsSecretIdWithResponse call +func ParsePatchUserSecretsSecretIdResponse(rsp *http.Response) (*PatchUserSecretsSecretIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PatchUserSecretsSecretIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest SecretWithId + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUsersResponse parses an HTTP response from a GetUsersWithResponse call +func ParseGetUsersResponse(rsp *http.Response) (*GetUsersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetUsersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UsersWithId + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteUsersUserIdResponse parses an HTTP response from a DeleteUsersUserIdWithResponse call +func ParseDeleteUsersUserIdResponse(rsp *http.Response) (*DeleteUsersUserIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteUsersUserIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUsersUserIdResponse parses an HTTP response from a GetUsersUserIdWithResponse call +func ParseGetUsersUserIdResponse(rsp *http.Response) (*GetUsersUserIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetUsersUserIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UserWithId + 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 == 404: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetVersionResponse parses an HTTP response from a GetVersionWithResponse call +func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetVersionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Version + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+xbe3PbNhL/KhhcZ5q0pPWwndT6586N26vbpOeJ7XQmtk8DESsJNQmwAGhb9ei73+DB", + "l0jJVO2kSeb+skURwD5++8MuFrrHkUhSwYFrhUf3WIJKBVdgP/wgpZDmn0hwDVybf0maxiwimgne+10J", + "bp6paA4JMf99JWGKR/gfvXLWnvtW9exsb/38eLlcBpiCiiRLzWR4hM/mgNzLaCokInGM9u7uEOEU7d/d", + "oVI0M9TPahY9pPSEcQ70RIrfIXJiUsrMtCQ+kSIFqZlRaUpiBQFOK4/uzSczaqzibPaQDn6FU/OqkULC", + "HxmTQPHooj7PVYD1IgU8wmJiZVoGuG4At3JFDsitXX8cCWpfhjuSpDHg0WCvvxdguIviTLEbeMM4S7IE", + "j7TMIMBJ/rFfSMC4hhlIbA2uCYtr0+FDlAgJyH0FFInUGQ4loBSZAVJzccv4DN3OiUZ6DiiVYhJDgm6J", + "wsUqSkvGZ2YRP66+yqlIQM/tNMA1upWCz1CI0hiIAqTlApEZYRzFRINsm1VLEsGYUTNtHTenwM14+wI6", + "PrLgiRm/NotpgSIhHXSoeRCLGTLvG+sGFflIdLB7sN+HAxgM9sj+fvTi5XTyHezDdH9wMJlAU6QV91s/", + "lco3AbDyvnN3K07uUiZthJ2xBJQmSdpU2gQLJRpseGiWgPWMgkiCRkwhLjS6ITGjiPCFdfAzPWfKfMW4", + "eWY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BnvgOe", + "sh4lmuDl1fJ/AQAA///7+8OCPTkAAA==", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %w", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + res := make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + resolvePath := PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + pathToFile := url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} From ef0a088980e3fe62d974c353398ff624cd3cf17d Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Mon, 4 May 2026 09:03:23 +0200 Subject: [PATCH 4/5] build: upgrade oapi-codegen/oapi-codegen to v2.7.0 --- Makefile | 4 +- go.mod | 19 +- go.sum | 39 ++- pkg/renkuapi/session/session_gen.go | 449 ++++++++++++++++++++-------- pkg/renkuapi/users/api.spec.yaml | 7 - pkg/renkuapi/users/users_gen.go | 394 +++++++++++++++++------- 6 files changed, 634 insertions(+), 278 deletions(-) diff --git a/Makefile b/Makefile index 52867da..ec482ca 100644 --- a/Makefile +++ b/Makefile @@ -96,5 +96,5 @@ pkg/renkuapi/session/session_gen.go: pkg/renkuapi/session/api.spec.yaml .PHONY: cleanup-generate cleanup-generate: ## Remove generated files - rm pkg/renkuapi/users/users_gen.go - rm pkg/renkuapi/session/session_gen.go + rm pkg/renkuapi/users/users_gen.go || true + rm pkg/renkuapi/session/session_gen.go || true diff --git a/go.mod b/go.mod index 6a60ab0..a8f49f3 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/containerd/containerd/v2 v2.2.3 github.com/distribution/distribution/v3 v3.1.0 github.com/distribution/reference v0.6.0 - github.com/getkin/kin-openapi v0.135.0 + github.com/getkin/kin-openapi v0.137.0 github.com/golang-jwt/jwt/v5 v5.3.1 github.com/oapi-codegen/runtime v1.4.0 github.com/opencontainers/image-spec v1.1.1 @@ -37,9 +37,10 @@ require ( github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/godbus/dbus/v5 v5.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -48,29 +49,30 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/mailru/easyjson v0.9.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/oapi-codegen/oapi-codegen/v2 v2.6.0 // indirect + github.com/oapi-codegen/oapi-codegen/v2 v2.7.0 // indirect github.com/oasdiff/yaml v0.0.9 // indirect - github.com/oasdiff/yaml3 v0.0.9 // indirect + github.com/oasdiff/yaml3 v0.0.12 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/sagikazarmark/locafero v0.11.0 // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect github.com/sirupsen/logrus v1.9.4 // indirect github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect - github.com/speakeasy-api/jsonpath v0.6.0 // indirect - github.com/speakeasy-api/openapi-overlay v0.10.2 // indirect + github.com/speakeasy-api/jsonpath v0.6.3 // indirect + github.com/speakeasy-api/openapi v1.19.2 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect - github.com/woodsbury/decimal128 v1.3.0 // indirect + github.com/woodsbury/decimal128 v1.4.0 // indirect github.com/x448/float16 v0.8.4 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 // indirect @@ -94,7 +96,6 @@ require ( google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.140.0 // indirect k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a // indirect diff --git a/go.sum b/go.sum index a56553d..2f65087 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,8 @@ github.com/distribution/distribution/v3 v3.1.0 h1:u1v788HreKTLGdNY6s7px8Exgrs9mZ github.com/distribution/distribution/v3 v3.1.0/go.mod h1:73BuF5/ziMHNVt7nnL1roYpH4Eg/FgUlKZm3WryIx/o= 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.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= +github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= 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= @@ -40,21 +42,25 @@ github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= 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/getkin/kin-openapi v0.135.0 h1:751SjYfbiwqukYuVjwYEIKNfrSwS5YpA7DZnKSwQgtg= -github.com/getkin/kin-openapi v0.135.0/go.mod h1:6dd5FJl6RdX4usBtFBaQhk9q62Yb2J0Mk5IhUO/QqFI= +github.com/getkin/kin-openapi v0.137.0 h1:Q3HhawNQV0GfvO2mIYMUBUSEFrDsVlzcYz4VydL9YEo= +github.com/getkin/kin-openapi v0.137.0/go.mod h1:vUYWaKyMqj7PfTybelXtLuLN9tReS12vxnzMRK+z2GY= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= 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.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= -github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= +github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= @@ -106,8 +112,9 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +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/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -121,14 +128,14 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m 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/oapi-codegen/v2 v2.6.0 h1:4i+F2cvwBFZeplxCssNdLy3MhNzUD87mI3HnayHZkAU= -github.com/oapi-codegen/oapi-codegen/v2 v2.6.0/go.mod h1:eWHeJSohQJIINJZzzQriVynfGsnlQVh0UkN2UYYcw4Q= +github.com/oapi-codegen/oapi-codegen/v2 v2.7.0 h1:/8daqIYZfwnsHEAZdHUu9m0D5LA+5DoJCP7zLlT5Cs0= +github.com/oapi-codegen/oapi-codegen/v2 v2.7.0/go.mod h1:qzFy6iuobJw/hD1aRILee4G87/ShmhR0xYCwcUtZMCw= github.com/oapi-codegen/runtime v1.4.0 h1:KLOSFOp7UzkbS7Cs1ms6NBEKYr0WmH2wZG0KKbd2er4= github.com/oapi-codegen/runtime v1.4.0/go.mod h1:5sw5fxCDmnOzKNYmkVNF8d34kyUeejJEY8HNT2WaPec= 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/oasdiff/yaml3 v0.0.12 h1:75urAtPeDg2/iDEWwzNrLOWxI9N/dCh81nTTJtokt2M= +github.com/oasdiff/yaml3 v0.0.12/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= @@ -157,16 +164,18 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= -github.com/speakeasy-api/jsonpath v0.6.0 h1:IhtFOV9EbXplhyRqsVhHoBmmYjblIRh5D1/g8DHMXJ8= -github.com/speakeasy-api/jsonpath v0.6.0/go.mod h1:ymb2iSkyOycmzKwbEAYPJV/yi2rSmvBCLZJcyD+VVWw= -github.com/speakeasy-api/openapi-overlay v0.10.2 h1:VOdQ03eGKeiHnpb1boZCGm7x8Haj6gST0P3SGTX95GU= -github.com/speakeasy-api/openapi-overlay v0.10.2/go.mod h1:n0iOU7AqKpNFfEt6tq7qYITC4f0yzVVdFw0S7hukemg= +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/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= @@ -198,8 +207,8 @@ github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65E github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= 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/woodsbury/decimal128 v1.3.0 h1:8pffMNWIlC0O5vbyHWFZAt5yWvWcrHA+3ovIIjVWss0= -github.com/woodsbury/decimal128 v1.3.0/go.mod h1:C5UTmyTjW3JftjUFzOVhC20BEQa2a4ZKOB5I6Zjb+ds= +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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/pkg/renkuapi/session/session_gen.go b/pkg/renkuapi/session/session_gen.go index 500816d..172813a 100644 --- a/pkg/renkuapi/session/session_gen.go +++ b/pkg/renkuapi/session/session_gen.go @@ -1,14 +1,15 @@ // Package session provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.0 DO NOT EDIT. package session import ( "bytes" - "compress/gzip" + "compress/flate" "context" "encoding/base64" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -944,6 +945,7 @@ func (t Build) AsBuildNotCompletedPart() (BuildNotCompletedPart, error) { // FromBuildNotCompletedPart overwrites any union data inside the Build as the provided BuildNotCompletedPart func (t *Build) FromBuildNotCompletedPart(v BuildNotCompletedPart) error { + v.Status = "BuildNotCompletedPart" b, err := json.Marshal(v) t.union = b return err @@ -951,6 +953,7 @@ func (t *Build) FromBuildNotCompletedPart(v BuildNotCompletedPart) error { // MergeBuildNotCompletedPart performs a merge with any union data inside the Build, using the provided BuildNotCompletedPart func (t *Build) MergeBuildNotCompletedPart(v BuildNotCompletedPart) error { + v.Status = "BuildNotCompletedPart" b, err := json.Marshal(v) if err != nil { return err @@ -970,6 +973,7 @@ func (t Build) AsBuildCompletedPart() (BuildCompletedPart, error) { // FromBuildCompletedPart overwrites any union data inside the Build as the provided BuildCompletedPart func (t *Build) FromBuildCompletedPart(v BuildCompletedPart) error { + v.Status = "BuildCompletedPart" b, err := json.Marshal(v) t.union = b return err @@ -977,6 +981,7 @@ func (t *Build) FromBuildCompletedPart(v BuildCompletedPart) error { // MergeBuildCompletedPart performs a merge with any union data inside the Build, using the provided BuildCompletedPart func (t *Build) MergeBuildCompletedPart(v BuildCompletedPart) error { + v.Status = "BuildCompletedPart" b, err := json.Marshal(v) if err != nil { return err @@ -987,6 +992,29 @@ func (t *Build) MergeBuildCompletedPart(v BuildCompletedPart) error { return err } +func (t Build) Discriminator() (string, error) { + var discriminator struct { + Discriminator string `json:"status"` + } + err := json.Unmarshal(t.union, &discriminator) + return discriminator.Discriminator, err +} + +func (t Build) ValueByDiscriminator() (interface{}, error) { + discriminator, err := t.Discriminator() + if err != nil { + return nil, err + } + switch discriminator { + case "BuildCompletedPart": + return t.AsBuildCompletedPart() + case "BuildNotCompletedPart": + return t.AsBuildNotCompletedPart() + default: + return nil, errors.New("unknown discriminator value: " + discriminator) + } +} + func (t Build) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() if err != nil { @@ -1788,7 +1816,7 @@ func NewGetBuildsBuildIdRequest(server string, buildId Ulid) (*http.Request, err return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -1833,7 +1861,7 @@ func NewPatchBuildsBuildIdRequestWithBody(server string, buildId Ulid, contentTy return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } @@ -1870,28 +1898,33 @@ func NewGetBuildsBuildIdLogsRequest(server string, buildId Ulid, params *GetBuil } 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.MaxLines != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "max_lines", *params.MaxLines, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) } } } - queryURL.RawQuery = queryValues.Encode() + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -1919,28 +1952,33 @@ func NewGetEnvironmentsRequest(server string, params *GetEnvironmentsParams) (*h } 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.GetEnvironmentParams != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "get_environment_params", *params.GetEnvironmentParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) } } } - queryURL.RawQuery = queryValues.Encode() + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -1978,7 +2016,7 @@ func NewPostEnvironmentsRequestWithBody(server string, contentType string, body return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } @@ -2014,7 +2052,7 @@ func NewDeleteEnvironmentsEnvironmentIdRequest(server string, environmentId Ulid return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -2048,7 +2086,7 @@ func NewGetEnvironmentsEnvironmentIdRequest(server string, environmentId Ulid) ( return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -2093,7 +2131,7 @@ func NewPatchEnvironmentsEnvironmentIdRequestWithBody(server string, environment return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } @@ -2129,7 +2167,7 @@ func NewGetEnvironmentsEnvironmentIdBuildsRequest(server string, environmentId U return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -2163,7 +2201,7 @@ func NewPostEnvironmentsEnvironmentIdBuildsRequest(server string, environmentId return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -2197,7 +2235,7 @@ func NewGetProjectsProjectIdSessionLaunchersRequest(server string, projectId Uli return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -2224,7 +2262,7 @@ func NewGetSessionLaunchersRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -2262,7 +2300,7 @@ func NewPostSessionLaunchersRequestWithBody(server string, contentType string, b return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } @@ -2298,7 +2336,7 @@ func NewDeleteSessionLaunchersLauncherIdRequest(server string, launcherId Ulid) return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -2332,7 +2370,7 @@ func NewGetSessionLaunchersLauncherIdRequest(server string, launcherId Ulid) (*h return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -2377,7 +2415,7 @@ func NewPatchSessionLaunchersLauncherIdRequestWithBody(server string, launcherId return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } @@ -2512,6 +2550,14 @@ func (r GetBuildsBuildIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetBuildsBuildIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PatchBuildsBuildIdResponse struct { Body []byte HTTPResponse *http.Response @@ -2535,6 +2581,14 @@ func (r PatchBuildsBuildIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchBuildsBuildIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetBuildsBuildIdLogsResponse struct { Body []byte HTTPResponse *http.Response @@ -2558,6 +2612,14 @@ func (r GetBuildsBuildIdLogsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetBuildsBuildIdLogsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetEnvironmentsResponse struct { Body []byte HTTPResponse *http.Response @@ -2581,6 +2643,14 @@ func (r GetEnvironmentsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetEnvironmentsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PostEnvironmentsResponse struct { Body []byte HTTPResponse *http.Response @@ -2604,6 +2674,14 @@ func (r PostEnvironmentsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostEnvironmentsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type DeleteEnvironmentsEnvironmentIdResponse struct { Body []byte HTTPResponse *http.Response @@ -2626,6 +2704,14 @@ func (r DeleteEnvironmentsEnvironmentIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteEnvironmentsEnvironmentIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetEnvironmentsEnvironmentIdResponse struct { Body []byte HTTPResponse *http.Response @@ -2650,6 +2736,14 @@ func (r GetEnvironmentsEnvironmentIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetEnvironmentsEnvironmentIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PatchEnvironmentsEnvironmentIdResponse struct { Body []byte HTTPResponse *http.Response @@ -2674,6 +2768,14 @@ func (r PatchEnvironmentsEnvironmentIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchEnvironmentsEnvironmentIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetEnvironmentsEnvironmentIdBuildsResponse struct { Body []byte HTTPResponse *http.Response @@ -2697,6 +2799,14 @@ func (r GetEnvironmentsEnvironmentIdBuildsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetEnvironmentsEnvironmentIdBuildsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PostEnvironmentsEnvironmentIdBuildsResponse struct { Body []byte HTTPResponse *http.Response @@ -2720,6 +2830,14 @@ func (r PostEnvironmentsEnvironmentIdBuildsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostEnvironmentsEnvironmentIdBuildsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetProjectsProjectIdSessionLaunchersResponse struct { Body []byte HTTPResponse *http.Response @@ -2743,6 +2861,14 @@ func (r GetProjectsProjectIdSessionLaunchersResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetProjectsProjectIdSessionLaunchersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetSessionLaunchersResponse struct { Body []byte HTTPResponse *http.Response @@ -2766,6 +2892,14 @@ func (r GetSessionLaunchersResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetSessionLaunchersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PostSessionLaunchersResponse struct { Body []byte HTTPResponse *http.Response @@ -2789,6 +2923,14 @@ func (r PostSessionLaunchersResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostSessionLaunchersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type DeleteSessionLaunchersLauncherIdResponse struct { Body []byte HTTPResponse *http.Response @@ -2811,6 +2953,14 @@ func (r DeleteSessionLaunchersLauncherIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteSessionLaunchersLauncherIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetSessionLaunchersLauncherIdResponse struct { Body []byte HTTPResponse *http.Response @@ -2835,6 +2985,14 @@ func (r GetSessionLaunchersLauncherIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetSessionLaunchersLauncherIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PatchSessionLaunchersLauncherIdResponse struct { Body []byte HTTPResponse *http.Response @@ -2859,6 +3017,14 @@ func (r PatchSessionLaunchersLauncherIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchSessionLaunchersLauncherIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + // GetBuildsBuildIdWithResponse request returning *GetBuildsBuildIdResponse func (c *ClientWithResponses) GetBuildsBuildIdWithResponse(ctx context.Context, buildId Ulid, reqEditors ...RequestEditorFn) (*GetBuildsBuildIdResponse, error) { rsp, err := c.GetBuildsBuildId(ctx, buildId, reqEditors...) @@ -3585,104 +3751,106 @@ func ParsePatchSessionLaunchersLauncherIdResponse(rsp *http.Response) (*PatchSes return response, nil } -// Base64 encoded, gzipped, json marshaled Swagger object +// Base64 encoded, compressed with deflate, json marshaled OpenAPI spec. +// Stored as a slice of fixed-width chunks rather than one concatenated +// const string: with thousands of chunks the chained `+` fold is several +// times slower for the Go compiler than parsing a slice literal. var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+x8a3fbNtL/V8Hhf89p0qVuju3GfvV37Fz81El8fGm7if3oQORIQk0CLABK9rr67s8B", - "QFK8QBIpS3G62zeJJeEymPnNYGYwwKPjsTBiFKgUzuGjw0FEjArQH95yzrj6w2NUApXqTxxFAfGwJIx2", - "fheMqu+EN4YQq7/+wWHoHDr/rzMftWN+FR092kUyvjObzVzHB+FxEqnBnEPnagzINEZDxhEOArR7f48w", - "9dHe/T2ak6a6JqOqSd/EJPA1bUHweegcfl1Oh25+zMKQ0XPMpTNzHx2fKEJCQrE0K444i4DLh084BOfQ", - "ERLLWDgz12EU6s7xicljFkYBSPCzmepQlu9yO7st8+kIKXlgQoEjEuIRoIHmgOvIh0hRywa/g6emc8pr", - "VUzyfaIGwsG5WSNRwh7iQICbLpsY+XscsAS/j+Uq2R6rloTREyxBzQt0QjijIVDZJ/6q3tcB8XUvhZA+", - "B5zgqgaadNOZ69SdZOY6HP6ICQffOfyqulWIdfPrvl3C1JyYmvGVg4iDlTzV01yYpgrwBoKHjw7QOFTE", - "i9jzAHzwFZVwjxVBCqvZ1xntQnJCR5XVJ0O6KUFLFksl3MsTonWjqrUcAizJBFCE5RhJhpQGBz5wx3VC", - "fH8GdCTHzuFet+s6IaHp516FwMp851h646dPap/mjAhZHfsIBURIxIZ2NVP8IhJCUUt+aq5kcsw5fpjP", - "zUZiMWweqxRXGRCwkVBk4oX2IAOFMeG6SevIOXTO2AgFhALq3dDs7x0F/azZm8XNZotwUrF4zfSiCnFC", - "+xFnIw5CsX2ISaBh7WHqQRCUkV9sXQv7CyF/jjkOQQIXKxdRlIzujaJ59/IqtXCA9yeYE0zrmQHgvySt", - "Z0ZGcC/7vlHHGjtKpr0z1xlyvZn7ded/l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ThjIGCDUint2kVqJexJO6/pZDx9SX13jWycbtbNrr79db3Krr6VB+077N", - "xkgTnE/axzerM9kyE/egsYnQjkJ+ib1ut1v1HOqNO/chimNqf3GDDsUTfYnmdlR7FfkVve6+7i5yM+oN", - "X3I47AyL15Tq9QKpbtIxsedxqxrrNjljrtiwJ6a2ikN8gCDSlrLZdqdMaXUbsQy8HraEXHH2v+5GuOic", - "X4+3Mv97vSiBp7e9b5u/K2Qat5lzf6JntJEdaytlH3bXqjEfDbYKW2KSWioDrsLJJQtz14BnIWm9zlK2", - "XnBjFeg34PzG2VxVHEuO8ALoXYx22t3v15VMTub7fnI036Ti5C+T8aldW79Wbsj5fry4TWSENu+qPV+i", - "yH6VIXXKCthPmGiINkArInyFY1aZum6OvpCIFxJzWc6dE3v6PO1oUjVbTabbE3BrpNNz91EWXFdQv6Hp", - "+GFRzRzyiY8okyi5waGZhSeY6CRScdGXEqLPsfw8/AihKV9eRFFy36pyLgjp5a5yGYJfLBvp7XZ3l/h4", - "S306HyQmQZGbRyhkHJD5CXzEInPigEIQQvFCjNlUiXs6xtIc9XA2CCBEUyxs60z6FWe5ZCHIsR4GqERT", - "zugItVAUABaAJH9AeIQJRQGW+sJIZVTJsQd9m1N8CVT11w2UYzxkHAWEaojqnCE3N9V09V3ARki1J8Wa", - "Igd7B68O9rpwAL3eLt7b8/Z/Gg5ewx4M93oHgwGsvL+g5TRffFWFy26CFrdN08vF25UFXwvgPwiUtkPH", - "Y0Y8aF5EmNtX9Bx5k1o+Xvp1DHIMHMkxEYUTeyJQuo/pWjmlL7quXgAiFFGYKryotQnEuPp5zsoBYwFg", - "WqRlQcH+tgm4KBS5l92rEZFoXjiKri/ObBi13HBYOFbye+P7WIsq5JtPZBnaeKrHARbidEH4aY5nhwS4", - "qTbOiic91cupU12XeBT5zMJqd9aHIaH6MFRLOQSJfSyxY70jub6bua636BNx1xfzoselXXP1kSY+6U/y", - "hXarq+SStsXgpom3WihaauS3ruMyGvVrcPE0BVVfg6pGx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p3TfWcg2v5W8RzhcU0Ml0Pk/2gs1wuOm25qagpdumIQq28D", - "Ox0ckY6+CzK7nf1fAAAA//9oBWzgQG0AAA==", -} - -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode + "7Hxrd9s20v9XweF/z2nSpW6O7cZ+9XfsXPzUSXx8abuJ/ehA5EhCTQIsAEr2uvruzwFAUrxAEilLcbrb", + "N4kl4TKY+c1gZjDAo+OxMGIUqBTO4aPDQUSMCtAf3nLOuPrDY1QClepPHEUB8bAkjHZ+F4yq74Q3hhCr", + "v/7BYegcOv+vMx+1Y34VHT3aRTK+M5vNXMcH4XESqcGcQ+dqDMg0RkPGEQ4CtHt/jzD10d79PZqTprom", + "o6pJ38Qk8DVtQfB56Bx+XU6Hbn7MwpDRc8ylM3MfHZ8oQkJCsTQrjjiLgMuHTzgE59AREstYODPXYRTq", + "zvGJyWMWRgFI8LOZ6lCW73I7uy3z6QgpeWBCgSMS4hGggeaA68iHSFHLBr+Dp6ZzymtVTPJ9ogbCwblZ", + "I1HCHuJAgJsumxj5exywBL+P5SrZHquWhNETLEHNC3RCOKMhUNkn/qre1wHxdS+FkD4HnOCqBpp005nr", + "1J1k5joc/ogJB985/Kq6VYh18+u+XcLUnJia8ZWDiIOVPNXTXJimCvAGgoePDtA4VMSL2PMAfPAVlXCP", + "FUEKq9nXGe1CckJHldUnQ7opQUsWSyXcyxOidaOqtRwCLMkEUITlGEmGlAYHPnDHdUJ8fwZ0JMfO4V63", + "6zohoennXoXAynznWHrjp09qn+aMCFkd+wgFREjEhnY1U/wiEkJRS35qrmRyzDl+mM/NRmIxbB6rFFcZ", + "ELCRUGTihfYgA4Ux4bpJ68g5dM7YCAWEAurd0OzvHQX9rNmbxc1mi3BSsXjN9KIKcUL7EWcjDkKxfYhJ", + "oGHtYepBEJSRX2xdC/sLIX+OOQ5BAhcrF1GUjO6Nonn38iq1cID3J5gTTOuZAeC/JK1nRkZwL/u+Ucca", + "O0qmvTPXGXK9mft153+XtM8REA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zxpTZMq+lWC6MYCWndN9ZyDa/lbxHOFxTQyXQ+T/aCzXC46bbmpqCl26YhCrbwM7HRyRjr4LMrud", + "/V8AAAD//w==", +} + +// decodeSpec returns the embedded OpenAPI spec as raw JSON bytes, +// after base64-decoding and flate-decompressing the embedded blob. func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + encoded := strings.Join(swaggerSpec, "") + compressed, err := base64.StdEncoding.DecodeString(encoded) if err != nil { return nil, fmt.Errorf("error base64 decoding spec: %w", err) } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } + zr := flate.NewReader(bytes.NewReader(compressed)) var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) + if _, err := buf.ReadFrom(zr); err != nil { + return nil, fmt.Errorf("read flate: %w", err) + } + if err := zr.Close(); err != nil { + return nil, fmt.Errorf("close flate reader: %w", err) } return buf.Bytes(), nil @@ -3690,7 +3858,7 @@ func decodeSpec() ([]byte, error) { var rawSpec = decodeSpecCached() -// a naive cached of a decoded swagger spec +// a naive cache of the decoded OpenAPI spec func decodeSpecCached() func() ([]byte, error) { data, err := decodeSpec() return func() ([]byte, error) { @@ -3708,12 +3876,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { return res } -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { +// GetSpec returns the OpenAPI specification corresponding to the generated +// code in this file. External references in the spec are resolved through +// PathToRawSpec; externally-referenced files must be embedded in their +// corresponding Go packages (via the import-mapping feature). URL-based +// external refs are not supported. +func GetSpec() (swagger *openapi3.T, err error) { resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() @@ -3739,3 +3907,22 @@ func GetSwagger() (swagger *openapi3.T, err error) { } return } + +// GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI +// specification: decompressed but not unmarshaled. External references +// are not resolved here; the bytes are the spec exactly as embedded by +// codegen. The result is cached at package init time, so repeated calls +// are cheap. +func GetSpecJSON() ([]byte, error) { + return rawSpec() +} + +// GetSwagger returns the OpenAPI specification corresponding to the +// generated code in this file. +// +// Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger +// to openapi3.T. Use [GetSpec] instead. This wrapper is retained for +// backwards compatibility. +func GetSwagger() (*openapi3.T, error) { + return GetSpec() +} diff --git a/pkg/renkuapi/users/api.spec.yaml b/pkg/renkuapi/users/api.spec.yaml index 72e7023..5fb57f8 100644 --- a/pkg/renkuapi/users/api.spec.yaml +++ b/pkg/renkuapi/users/api.spec.yaml @@ -619,10 +619,3 @@ components: "application/json": schema: $ref: "#/components/schemas/ErrorResponse" - securitySchemes: - oidc: - type: openIdConnect - openIdConnectUrl: /auth/realms/Renku/.well-known/openid-configuration -security: - - oidc: - - openid diff --git a/pkg/renkuapi/users/users_gen.go b/pkg/renkuapi/users/users_gen.go index f8d0c54..6f50334 100644 --- a/pkg/renkuapi/users/users_gen.go +++ b/pkg/renkuapi/users/users_gen.go @@ -1,11 +1,11 @@ // Package users provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.0 DO NOT EDIT. package users import ( "bytes" - "compress/gzip" + "compress/flate" "context" "encoding/base64" "encoding/json" @@ -21,10 +21,6 @@ import ( "github.com/oapi-codegen/runtime" ) -const ( - OidcScopes = "oidc.Scopes" -) - // Defines values for SecretKind. const ( General SecretKind = "general" @@ -660,7 +656,7 @@ func NewGetErrorRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -687,7 +683,7 @@ func NewGetUserRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -714,7 +710,7 @@ func NewGetUserPreferencesRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -741,7 +737,7 @@ func NewDeleteUserPreferencesDismissProjectMigrationBannerRequest(server string) return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -768,7 +764,7 @@ func NewPostUserPreferencesDismissProjectMigrationBannerRequest(server string) ( return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -796,28 +792,33 @@ func NewDeleteUserPreferencesPinnedProjectsRequest(server string, params *Delete } 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.DeletePinnedParams != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "delete_pinned_params", *params.DeletePinnedParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) } } } - queryURL.RawQuery = queryValues.Encode() + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -855,7 +856,7 @@ func NewPostUserPreferencesPinnedProjectsRequestWithBody(server string, contentT return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } @@ -884,7 +885,7 @@ func NewGetUserSecretKeyRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -912,28 +913,33 @@ func NewGetUserSecretsRequest(server string, params *GetUserSecretsParams) (*htt } 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.UserSecretsParams != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "user_secrets_params", *params.UserSecretsParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) } } } - queryURL.RawQuery = queryValues.Encode() + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -971,7 +977,7 @@ func NewPostUserSecretsRequestWithBody(server string, contentType string, body i return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } @@ -1007,7 +1013,7 @@ func NewDeleteUserSecretsSecretIdRequest(server string, secretId Ulid) (*http.Re return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -1041,7 +1047,7 @@ func NewGetUserSecretsSecretIdRequest(server string, secretId Ulid) (*http.Reque return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -1086,7 +1092,7 @@ func NewPatchUserSecretsSecretIdRequestWithBody(server string, secretId Ulid, co return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } @@ -1116,28 +1122,33 @@ func NewGetUsersRequest(server string, params *GetUsersParams) (*http.Request, e } 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.UserParams != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "user_params", *params.UserParams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "object", Format: ""}); err != nil { return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) } } } - queryURL.RawQuery = queryValues.Encode() + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -1171,7 +1182,7 @@ func NewDeleteUsersUserIdRequest(server string, userId string) (*http.Request, e return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -1205,7 +1216,7 @@ func NewGetUsersUserIdRequest(server string, userId string) (*http.Request, erro return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -1232,7 +1243,7 @@ func NewGetVersionRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -1363,6 +1374,14 @@ func (r GetErrorResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetErrorResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetUserResponse struct { Body []byte HTTPResponse *http.Response @@ -1386,6 +1405,14 @@ func (r GetUserResponse) StatusCode() int { 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 GetUserPreferencesResponse struct { Body []byte HTTPResponse *http.Response @@ -1410,6 +1437,14 @@ func (r GetUserPreferencesResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetUserPreferencesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type DeleteUserPreferencesDismissProjectMigrationBannerResponse struct { Body []byte HTTPResponse *http.Response @@ -1433,6 +1468,14 @@ func (r DeleteUserPreferencesDismissProjectMigrationBannerResponse) StatusCode() return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteUserPreferencesDismissProjectMigrationBannerResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PostUserPreferencesDismissProjectMigrationBannerResponse struct { Body []byte HTTPResponse *http.Response @@ -1456,6 +1499,14 @@ func (r PostUserPreferencesDismissProjectMigrationBannerResponse) StatusCode() i return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostUserPreferencesDismissProjectMigrationBannerResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type DeleteUserPreferencesPinnedProjectsResponse struct { Body []byte HTTPResponse *http.Response @@ -1479,6 +1530,14 @@ func (r DeleteUserPreferencesPinnedProjectsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteUserPreferencesPinnedProjectsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PostUserPreferencesPinnedProjectsResponse struct { Body []byte HTTPResponse *http.Response @@ -1502,6 +1561,14 @@ func (r PostUserPreferencesPinnedProjectsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostUserPreferencesPinnedProjectsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetUserSecretKeyResponse struct { Body []byte HTTPResponse *http.Response @@ -1525,6 +1592,14 @@ func (r GetUserSecretKeyResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetUserSecretKeyResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetUserSecretsResponse struct { Body []byte HTTPResponse *http.Response @@ -1549,6 +1624,14 @@ func (r GetUserSecretsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetUserSecretsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PostUserSecretsResponse struct { Body []byte HTTPResponse *http.Response @@ -1572,6 +1655,14 @@ func (r PostUserSecretsResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PostUserSecretsResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type DeleteUserSecretsSecretIdResponse struct { Body []byte HTTPResponse *http.Response @@ -1594,6 +1685,14 @@ func (r DeleteUserSecretsSecretIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteUserSecretsSecretIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetUserSecretsSecretIdResponse struct { Body []byte HTTPResponse *http.Response @@ -1618,6 +1717,14 @@ func (r GetUserSecretsSecretIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetUserSecretsSecretIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type PatchUserSecretsSecretIdResponse struct { Body []byte HTTPResponse *http.Response @@ -1641,6 +1748,14 @@ func (r PatchUserSecretsSecretIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PatchUserSecretsSecretIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetUsersResponse struct { Body []byte HTTPResponse *http.Response @@ -1664,6 +1779,14 @@ func (r GetUsersResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetUsersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type DeleteUsersUserIdResponse struct { Body []byte HTTPResponse *http.Response @@ -1686,6 +1809,14 @@ func (r DeleteUsersUserIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteUsersUserIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetUsersUserIdResponse struct { Body []byte HTTPResponse *http.Response @@ -1710,6 +1841,14 @@ func (r GetUsersUserIdResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetUsersUserIdResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type GetVersionResponse struct { Body []byte HTTPResponse *http.Response @@ -1732,6 +1871,14 @@ func (r GetVersionResponse) StatusCode() int { return 0 } +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetVersionResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + // GetErrorWithResponse request returning *GetErrorResponse func (c *ClientWithResponses) GetErrorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetErrorResponse, error) { rsp, err := c.GetError(ctx, reqEditors...) @@ -2470,75 +2617,75 @@ func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) { return response, nil } -// Base64 encoded, gzipped, json marshaled Swagger object +// Base64 encoded, compressed with deflate, json marshaled OpenAPI spec. +// Stored as a slice of fixed-width chunks rather than one concatenated +// const string: with thousands of chunks the chained `+` fold is several +// times slower for the Go compiler than parsing a slice literal. var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+xbe3PbNhL/KhhcZ5q0pPWwndT6586N26vbpOeJ7XQmtk8DESsJNQmwAGhb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8F4cQ0ozSYxi+KFr3bYJAZTxjxFelMR", - "p/V4xvskb140XKG6+aGFjjuwrUWCX+eRZLttY+zvJdxqS2lD5vu1KrpKf1vyTQU4kMJdvYP61zBpVLYM", - "7xVzF0ndUs+uYaGQ4PHieSs0H+L5EoofgtUrVyQ68fngiVfOD6WavvLte5VZ9phmcbwobmA81l+v7DyI", - "IA63OXXkFdJKNbSeQ3r3ntcZXXZL+7wr3Z9j2mQXSycp0fOSTYo18Kpzgq50b5tELZG/t+beWnn70alk", - "bz9SRvnXTxUvziSIlJch2uKiA0F/Kqbsf7SwKD30xbCnP80rE47JAlkntZJlfoVuhS3N408DGB+MpK3m", - "nwNLzwmfPQVL23k2s0ROyg9mdI/I5R6Xw8EdifQY2rvxb0Fnkhf7zjP13J1fE47sOJQYp/ub3K5tnzce", - "6KdYb6vNxJXfKnI5O+P+tr1ruZTX6pHKJgrsm/bHH+7HA3l///nTpWuZB8a6c27Vu/d96I47vPLtyy6s", - "U3a413POqoM7b+KWp80WXovM+n7+hBRebugpRGzKIifAZOF/gVDczbDXMlbNvXmr//g2fdqY2BwSfr/w", - "JxZf2p7+V9Bggq/SZV4HjbxD/QG9ly+xZWfSkJpXID878RznZsqb3xbEru19gV0TG18ZOJq3c5BnvgOe", - "sh4lmuDl1fJ/AQAA///7+8OCPTkAAA==", -} - -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode + "7Ft7c9s2Ev8qGFxnmrSk9bCd1Prnzq3bq9uk50mcdCa2TwMRKwk1CbAAaFv16Lvf4MGXSMlUraRu5v6K", + "RRLAPn77210AuceRSFLBgWuFR/dYgkoFV2B/fC+lkOaPSHANXJs/SZrGLCKaCd77TQlunqloDgkxf30h", + "YYpH+B+9ctaee6t6drY3fn68XC4DTEFFkqVmMjzC53NA7mM0FRKROEYHd3eIcIoO7+5QKZoZ6mc1ix5T", + "esY4B3omxW8QOTEpZWZaEp9JkYLUzKg0JbGCAKeVR/fmlxk1VnE2e0gHv8Jb86mRQsLvG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nmt9hW2NI8fhrA+GgkbTX/O7D0nPDZLljazrOZ", + "JXJSfrCie0Qt97gaDu5IpMfQfiD+BnQmeZF3nqnnbv+acGTHocQ43V+mdifn+cEDfYr9ttpMXPnFHlez", + "M+4vvLsjl/JmO1LZRIH90v7/C3d/Pz9if767ci3zwFi3z6169/4ouGOGV/4EsQvrlIfM6zln1cGdk7jl", + "aZPCa5FZz+c7pPAyoacQsSmLnACThf9PAMX1CHszYtXcm1P9p7fpbmNic0j4fOF3LD63nP5n0GCCr3LQ", + "uw4a+SHxR/RevsSWJ5OG1LwC+d6J5zg3k/mRYziTMR7hHklZjxJN8PJq+b8AAAD//w==", +} + +// decodeSpec returns the embedded OpenAPI spec as raw JSON bytes, +// after base64-decoding and flate-decompressing the embedded blob. func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + encoded := strings.Join(swaggerSpec, "") + compressed, err := base64.StdEncoding.DecodeString(encoded) if err != nil { return nil, fmt.Errorf("error base64 decoding spec: %w", err) } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } + zr := flate.NewReader(bytes.NewReader(compressed)) var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) + if _, err := buf.ReadFrom(zr); err != nil { + return nil, fmt.Errorf("read flate: %w", err) + } + if err := zr.Close(); err != nil { + return nil, fmt.Errorf("close flate reader: %w", err) } return buf.Bytes(), nil @@ -2546,7 +2693,7 @@ func decodeSpec() ([]byte, error) { var rawSpec = decodeSpecCached() -// a naive cached of a decoded swagger spec +// a naive cache of the decoded OpenAPI spec func decodeSpecCached() func() ([]byte, error) { data, err := decodeSpec() return func() ([]byte, error) { @@ -2564,12 +2711,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { return res } -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { +// GetSpec returns the OpenAPI specification corresponding to the generated +// code in this file. External references in the spec are resolved through +// PathToRawSpec; externally-referenced files must be embedded in their +// corresponding Go packages (via the import-mapping feature). URL-based +// external refs are not supported. +func GetSpec() (swagger *openapi3.T, err error) { resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() @@ -2595,3 +2742,22 @@ func GetSwagger() (swagger *openapi3.T, err error) { } return } + +// GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI +// specification: decompressed but not unmarshaled. External references +// are not resolved here; the bytes are the spec exactly as embedded by +// codegen. The result is cached at package init time, so repeated calls +// are cheap. +func GetSpecJSON() ([]byte, error) { + return rawSpec() +} + +// GetSwagger returns the OpenAPI specification corresponding to the +// generated code in this file. +// +// Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger +// to openapi3.T. Use [GetSpec] instead. This wrapper is retained for +// backwards compatibility. +func GetSwagger() (*openapi3.T, error) { + return GetSpec() +} From 899a6ff8aaa0f3a7373a1e26220cd5c8811c4c3b Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Mon, 4 May 2026 09:05:16 +0200 Subject: [PATCH 5/5] fix --- .github/workflows/test.yaml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4062ece..3b6c342 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,13 +17,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - + - name: Install Go uses: actions/setup-go@v6 with: - go-version: '1.26' + go-version: "1.26" check-latest: true - + - name: Install libraries for ubuntu run: | sudo apt install libx11-dev @@ -48,13 +48,23 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - + - name: Install Go uses: actions/setup-go@v6 with: - go-version: '1.26' + go-version: "1.26" check-latest: true + - name: Install libraries for ubuntu + run: | + sudo apt install libx11-dev + + - name: Print environment + run: | + which go + go env + make vars + - name: Test code generation run: | make cleanup-generate @@ -66,17 +76,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - + - name: Install Go uses: actions/setup-go@v6 with: - go-version: '1.26' + go-version: "1.26" check-latest: true - name: Install libraries for ubuntu run: | sudo apt install libx11-dev - + - name: Run golangci-lint uses: golangci/golangci-lint-action@v9 with: